From 6125565c43cc1302e7f5b6b9fd2af3b55b200baf Mon Sep 17 00:00:00 2001 From: drkthunder02 Date: Mon, 11 May 2026 19:20:41 -0500 Subject: [PATCH] Added Schema check in Announcements plugin. --- .../001_create_announcements_table.php | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/announcements/database/migrations/001_create_announcements_table.php b/announcements/database/migrations/001_create_announcements_table.php index 31d2b414..ee677f3d 100644 --- a/announcements/database/migrations/001_create_announcements_table.php +++ b/announcements/database/migrations/001_create_announcements_table.php @@ -8,16 +8,18 @@ { public function up(): void { - Schema::create('announcements', function (Blueprint $table) { - $table->increments('id'); - $table->string('title'); - $table->string('body')->nullable(); - $table->string('type')->default('info'); - $table->json('panels')->nullable(); - $table->timestamp('valid_from')->nullable(); - $table->timestamp('valid_to')->nullable(); - $table->timestamps(); - }); + if(!Schema::hasTable('announcements')) { + Schema::create('announcements', function (Blueprint $table) { + $table->increments('id'); + $table->string('title'); + $table->string('body')->nullable(); + $table->string('type')->default('info'); + $table->json('panels')->nullable(); + $table->timestamp('valid_from')->nullable(); + $table->timestamp('valid_to')->nullable(); + $table->timestamps(); + }); + } } public function down(): void