feat: more API endpoints

This commit is contained in:
Andras Bacsai
2024-06-26 13:00:36 +02:00
parent eb76d63117
commit f45b3cab55
10 changed files with 433 additions and 98 deletions

View File

@@ -1,8 +1,10 @@
<?php
use App\Models\EnvironmentVariable;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Visus\Cuid2\Cuid2;
return new class extends Migration
{
@@ -16,6 +18,18 @@ return new class extends Migration
$table->dropColumn('docker_compose_pr');
$table->dropColumn('docker_compose_pr_raw');
});
Schema::table('environment_variables', function (Blueprint $table) {
$table->string('uuid')->nullable()->after('id');
});
EnvironmentVariable::all()->each(function (EnvironmentVariable $environmentVariable) {
$environmentVariable->update([
'uuid' => (string) new Cuid2(),
]);
});
Schema::table('environment_variables', function (Blueprint $table) {
$table->string('uuid')->nullable(false)->change();
});
}
/**
@@ -28,5 +42,9 @@ return new class extends Migration
$table->longText('docker_compose_pr')->nullable()->after('docker_compose_location');
$table->longText('docker_compose_pr_raw')->nullable()->after('docker_compose');
});
Schema::table('environment_variables', function (Blueprint $table) {
$table->dropColumn('uuid');
});
}
};