3 use Illuminate\Database\Migrations\Migration;
4 use Illuminate\Database\Schema\Blueprint;
5 use Illuminate\Support\Facades\Schema;
7 return new class extends Migration
16 Schema::create('applications', function (Blueprint $table) {
18 $table->foreignId('tournament_id')->constrained();
19 $table->foreignId('user_id')->constrained();
20 $table->boolean('denied')->default(false);
23 $table->unique(['tournament_id', 'user_id']);
25 Schema::table('tournaments', function(Blueprint $table) {
26 $table->boolean('accept_applications')->default(false);
28 Schema::table('participants', function(Blueprint $table) {
29 $table->unique(['tournament_id', 'user_id']);
34 * Reverse the migrations.
38 public function down()
40 Schema::table('tournaments', function(Blueprint $table) {
41 $table->dropColumn('accept_applications');
43 Schema::dropIfExists('applications');