fix: make notifications migration idempotent

This commit is contained in:
F4ilji
2026-09-18 02:58:52 +05:00
parent 7ff860feca
commit 8af94388ab
@@ -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();
});
}
}
/**