Add create and show page for competition

This commit is contained in:
unurled 2025-07-03 20:18:53 +02:00
parent 1485f3daf5
commit 744308d0cb
10 changed files with 151 additions and 72 deletions

View file

@ -17,7 +17,6 @@ return new class extends Migration
$table->string('name');
$table->text('description')->nullable();
$table->date('start_date');
$table->date('end_date');
$table->string('status')->default('planned');
$table->string('location')->nullable();
$table->integer('max_teams')->default(0);
@ -31,6 +30,11 @@ return new class extends Migration
$table->id();
$table->string('name');
$table->text('description')->nullable();
$table->integer('competition_id')->nullable();
$table->string('algorithm')->default('round_robin');
$table->json('config')->nullable();
$table->integer('sequence_order')->default(1);
$table->string('status')->default('active');
$table->timestamps();
});
@ -48,6 +52,13 @@ return new class extends Migration
$table->timestamps();
});
Schema::create('competition_field', function (Blueprint $table) {
$table->id();
$table->foreignId('competition_id')->constrained('competitions')->onDelete('cascade');
$table->foreignId('field_id')->constrained('fields')->onDelete('cascade');
$table->timestamps();
});
// Create teams table
Schema::create('teams', function (Blueprint $table) {
$table->id();
@ -59,12 +70,11 @@ return new class extends Migration
$table->timestamps();
});
// Create team members table
Schema::create('team_members', function (Blueprint $table) {
Schema::create('competition_team', function (Blueprint $table) {
$table->id();
$table->foreignId('competition_id')->constrained('competitions')->onDelete('cascade');
$table->foreignId('team_id')->constrained('teams')->onDelete('cascade');
$table->foreignId('user_id')->constrained('users')->onDelete('cascade');
$table->string('role')->default('member');
$table->string('status')->default('confirmed');
$table->timestamps();
});
@ -103,7 +113,7 @@ return new class extends Migration
{
Schema::dropIfExists('break_periods');
Schema::dropIfExists('matches');
Schema::dropIfExists('team_members');
Schema::dropIfExists('competition_team');
Schema::dropIfExists('teams');
Schema::dropIfExists('fields');
Schema::dropIfExists('scheduling_modes');