From 8af94388ab96537b1efbc880f2c7a39b8b1a9e75 Mon Sep 17 00:00:00 2001 From: F4ilji Date: Fri, 18 Sep 2026 02:58:52 +0500 Subject: [PATCH] fix: make notifications migration idempotent --- ...09_18_021743_create_notifications_table.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/database/migrations/2026_09_18_021743_create_notifications_table.php b/database/migrations/2026_09_18_021743_create_notifications_table.php index d738032..8d4ad46 100644 --- a/database/migrations/2026_09_18_021743_create_notifications_table.php +++ b/database/migrations/2026_09_18_021743_create_notifications_table.php @@ -11,14 +11,16 @@ return new class extends Migration */ public function up(): void { - Schema::create('notifications', function (Blueprint $table) { - $table->uuid('id')->primary(); - $table->string('type'); - $table->morphs('notifiable'); - $table->text('data'); - $table->timestamp('read_at')->nullable(); - $table->timestamps(); - }); + if (!Schema::hasTable('notifications')) { + Schema::create('notifications', function (Blueprint $table) { + $table->uuid('id')->primary(); + $table->string('type'); + $table->morphs('notifiable'); + $table->text('data'); + $table->timestamp('read_at')->nullable(); + $table->timestamps(); + }); + } } /**