From 9e707ce618dd215f2b97a493bdde57b6538a3b53 Mon Sep 17 00:00:00 2001 From: Codex Agent Date: Sat, 15 Nov 2025 21:26:00 +0100 Subject: [PATCH] fixed photos+likes system migration --- .../2025_09_01_000400_create_photos_likes.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/database/migrations/2025_09_01_000400_create_photos_likes.php b/database/migrations/2025_09_01_000400_create_photos_likes.php index 933d236..c221570 100644 --- a/database/migrations/2025_09_01_000400_create_photos_likes.php +++ b/database/migrations/2025_09_01_000400_create_photos_likes.php @@ -9,11 +9,11 @@ return new class extends Migration public function up(): void { // Photos table - if (!Schema::hasTable('photos')) { + if (! Schema::hasTable('photos')) { Schema::create('photos', function (Blueprint $table) { $table->id(); $table->unsignedBigInteger('event_id'); - $table->unsignedBigInteger('emotion_id'); + $table->unsignedBigInteger('emotion_id')->nullable(); $table->unsignedBigInteger('task_id')->nullable(); $table->string('guest_name'); $table->string('file_path'); @@ -31,7 +31,7 @@ return new class extends Migration }); } else { // Add tenant_id if missing (consolidate duplicates) - if (!Schema::hasColumn('photos', 'tenant_id')) { + if (! Schema::hasColumn('photos', 'tenant_id')) { Schema::table('photos', function (Blueprint $table) { $table->unsignedBigInteger('tenant_id')->nullable()->after('event_id'); $table->foreign('tenant_id')->references('id')->on('tenants')->onDelete('cascade'); @@ -41,7 +41,7 @@ return new class extends Migration } // Photo Likes table - if (!Schema::hasTable('photo_likes')) { + if (! Schema::hasTable('photo_likes')) { Schema::create('photo_likes', function (Blueprint $table) { $table->id(); $table->unsignedBigInteger('photo_id'); @@ -74,4 +74,4 @@ return new class extends Migration } } } -}; \ No newline at end of file +};