Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

fix: resolve duplicate migration timestamps and add idempotency guards

Andras Bacsai60ef63de541a
diff --git a/database/migrations/2025_10_10_120000_create_cloud_init_scripts_table.php b/database/migrations/2025_10_10_120000_create_cloud_init_scripts_table.php
index fe216a57da..932c551d7a 100644
--- a/database/migrations/2025_10_10_120000_create_cloud_init_scripts_table.php
+++ b/database/migrations/2025_10_10_120000_create_cloud_init_scripts_table.php
@@ -11,15 +11,17 @@ return new class extends Migration
*/
public function up(): void
{
- Schema::create('cloud_init_scripts', function (Blueprint $table) {
- $table->id();
- $table->foreignId('team_id')->constrained()->onDelete('cascade');
- $table->string('name');
- $table->text('script'); // Encrypted in the model
- $table->timestamps();
+ if (!Schema::hasTable('cloud_init_scripts')) {
+ Schema::create('cloud_init_scripts', function (Blueprint $table) {
+ $table->id();
+ $table->foreignId('team_id')->constrained()->onDelete('cascade');
+ $table->string('name');
+ $table->text('script'); // Encrypted in the model
+ $table->timestamps();
- $table->index('team_id');
- });
+ $table->index('team_id');
+ });
+ }
}
/**
diff --git a/database/migrations/2025_10_10_120000_create_webhook_notification_settings_table.php b/database/migrations/2025_10_10_120000_create_webhook_notification_settings_table.php
deleted file mode 100644
index a3edacbf96..0000000000
--- a/database/migrations/2025_10_10_120000_create_webhook_notification_settings_table.php
+++ /dev/null
@@ -1,46 +0,0 @@
-<?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('webhook_notification_settings', function (Blueprint $table) {
- $table->id();
- $table->foreignId('team_id')->constrained()->cascadeOnDelete();
-
- $table->boolean('webhook_enabled')->default(false);
- $table->text('webhook_url')->nullable();
-
- $table->boolean('deployment_success_webhook_notifications')->default(false);
- $table->boolean('deployment_failure_webhook_notifications')->default(true);
- $table->boolean('status_change_webhook_notifications')->default(false);
- $table->boolean('backup_success_webhook_notifications')->default(false);
- $table->boolean('backup_failure_webhook_notifications')->default(true);
- $table->boolean('scheduled_task_success_webhook_notifications')->default(false);
- $table->boolean('scheduled_task_failure_webhook_notifications')->default(true);
- $table->boolean('docker_cleanup_success_webhook_notifications')->default(false);
- $table->boolean('docker_cleanup_failure_webhook_notifications')->default(true);
- $table->boolean('server_disk_usage_webhook_notifications')->default(true);
- $table->boolean('server_reachable_webhook_notifications')->default(false);
- $table->boolean('server_unreachable_webhook_notifications')->default(true);
- $table->boolean('server_patch_webhook_notifications')->default(false);
-
- $table->unique(['team_id']);
- });
- }
-
- /**
- * Reverse the migrations.
- */
- public function down(): void
- {
- Schema::dropIfExists('webhook_notification_settings');
- }
-};
diff --git a/database/migrations/2025_10_10_120002_create_webhook_notification_settings_table.php b/database/migrations/2025_10_10_120002_create_webhook_notification_settings_table.php
new file mode 100644
index 0000000000..1c2aeff88c
--- /dev/null
+++ b/database/migrations/2025_10_10_120002_create_webhook_notification_settings_table.php
@@ -0,0 +1,48 @@
+<?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
+ {
+ if (!Schema::hasTable('webhook_notification_settings')) {
+ Schema::create('webhook_notification_settings', function (Blueprint $table) {
+ $table->id();
+ $table->foreignId('team_id')->constrained()->cascadeOnDelete();
+
+ $table->boolean('webhook_enabled')->default(false);
+ $table->text('webhook_url')->nullable();
+
+ $table->boolean('deployment_success_webhook_notifications')->default(false);
+ $table->boolean('deployment_failure_webhook_notifications')->default(true);
+ $table->boolean('status_change_webhook_notifications')->default(false);
+ $table->boolean('backup_success_webhook_notifications')->default(false);
+ $table->boolean('backup_failure_webhook_notifications')->default(true);
+ $table->boolean('scheduled_task_success_webhook_notifications')->default(false);
+ $table->boolean('scheduled_task_failure_webhook_notifications')->default(true);
+ $table->boolean('docker_cleanup_success_webhook_notifications')->default(false);
+ $table->boolean('docker_cleanup_failure_webhook_notifications')->default(true);
+ $table->boolean('server_disk_usage_webhook_notifications')->default(true);
+ $table->boolean('server_reachable_webhook_notifications')->default(false);
+ $table->boolean('server_unreachable_webhook_notifications')->default(true);
+ $table->boolean('server_patch_webhook_notifications')->default(false);
+
+ $table->unique(['team_id']);
+ });
+ }
+ }
+
+ /**
+ * Reverse the migrations.
+ */
+ public function down(): void
+ {
+ Schema::dropIfExists('webhook_notification_settings');
+ }
+};