fix: handle existing webhook_notification_settings table in migration

Similar to cloud_init_scripts, this migration was renamed from 120000 to
120002 between v444 and v445, causing "duplicate table" errors for users
upgrading who already have the webhook_notification_settings table created.

Added table existence check before creation for idempotency.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Andras Bacsai
2025-11-24 15:12:14 +01:00
parent 2335bfad8f
commit e930005a50

View File

@@ -11,6 +11,12 @@ return new class extends Migration
*/ */
public function up(): void public function up(): void
{ {
// Check if table already exists (handles upgrades from v444 where this migration
// was named 2025_10_10_120000_create_webhook_notification_settings_table.php)
if (Schema::hasTable('webhook_notification_settings')) {
return;
}
Schema::create('webhook_notification_settings', function (Blueprint $table) { Schema::create('webhook_notification_settings', function (Blueprint $table) {
$table->id(); $table->id();
$table->foreignId('team_id')->constrained()->cascadeOnDelete(); $table->foreignId('team_id')->constrained()->cascadeOnDelete();