#add git monitor

This commit is contained in:
2025-12-18 10:18:25 +08:00
parent 2ec44b5665
commit 5f6bba1d9f
18 changed files with 889 additions and 20 deletions

View File

@@ -0,0 +1,30 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('configs', function (Blueprint $table) {
$table->id();
$table->string('key')->unique();
$table->json('value')->nullable();
$table->string('description')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('configs');
}
};

View File

@@ -0,0 +1,40 @@
<?php
use App\Models\Config;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
if (!Schema::hasTable('configs')) {
return;
}
$exists = Config::query()->where('key', 'workspace.projects_path')->exists();
if (!$exists) {
Config::query()->create([
'key' => 'workspace.projects_path',
'value' => '/home/tradewind/Projects',
'description' => '默认的工作空间项目路径',
]);
}
}
/**
* Reverse the migrations.
*/
public function down(): void
{
if (!Schema::hasTable('configs')) {
return;
}
Config::query()->where('key', 'workspace.projects_path')->delete();
}
};