migrations and models adjusted

This commit is contained in:
2026-08-15 13:35:46 +02:00
parent 6152a0a122
commit c5fd3f9d79
16 changed files with 157 additions and 459 deletions
@@ -15,6 +15,7 @@ return new class extends Migration
$table->uuid('id')->primary();
$table->string('title', 100)->nullable();
$table->json('deck_config');
$table->string('join_code', 6)->unique();
$table->unsignedInteger('current_round')->default(1);
$table->timestamp('revealed_at')->nullable();
$table->unsignedBigInteger('state_version')->default(1);
@@ -17,8 +17,9 @@ return new class extends Migration
$table->foreignId('user_id')->nullable()->constrained()->nullOnDelete();
$table->string('name', 50);
$table->boolean('is_moderator')->default(false);
$table->timestamp('last_seen_at')->nullable();
$table->timestamps();
$table->unique(['room_id', 'user_id']);
$table->unique(['room_id', 'name']);
});
}
@@ -18,7 +18,7 @@ return new class extends Migration
$table->unsignedInteger('round');
$table->string('value', 16);
$table->timestamps();
$table->unique(['player_id', 'room']);
$table->unique(['player_id', 'room_id', 'round']);
});
}