mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-14 04:15:55 +00:00
fix(v5): backfill missing canvas uuid columns
Add guarded migration for existing v5 application, cluster, and resource connection tables missing uuid columns. Add Vitest, jsdom, and React Testing Library coverage for optimistic updates, canvas hooks, ingress, resource merging, viewport behavior, and v5 browser canvas and cluster flows.
This commit is contained in:
1 parent
fbc6fd5ce5
commit
a9501d5476
10 files changed
+2234
-28
No files matched your search
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
/**
|
||||
* The uuid columns were added by editing the original v5 create migrations,
|
||||
* so databases that ran those migrations before the edit (including the
|
||||
* checked-in testing schema dump) are missing them. Guarded so freshly
|
||||
* migrated databases are untouched.
|
||||
*/
|
||||
return new class extends Migration
|
||||
{
|
||||
private const TABLES = ['v5_applications', 'v5_clusters', 'v5_resource_connections'];
|
||||
|
||||
public function up(): void
|
||||
{
|
||||
foreach (self::TABLES as $tableName) {
|
||||
if (! Schema::hasTable($tableName) || Schema::hasColumn($tableName, 'uuid')) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Schema::table($tableName, function (Blueprint $table) {
|
||||
$table->string('uuid')->nullable()->unique();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
// Intentionally left empty: the uuid columns belong to the create
|
||||
// migrations; dropping them here could destroy live identifiers.
|
||||
}
|
||||
};
|
||||
Reference in new issue
Block a user