Schema::create('users', function (Blueprint $table) { $table->id(); $table->string('name'); $table->string('email')->unique(); $table->timestamp('email_verified_at')->nullable(); $table->string('password'); $table->char('locale', 2)->default('de'); $table->boolean('active')->default(false); $table->rememberToken(); $table->timestamps(); $table->softDeletes(); }); Schema::create('polls', function (Blueprint $table) { $table->id(); $table->foreignId('user_id'); $table->string('title'); $table->string('description', 2000)->nullable(); $table->string('bg_image_path', 1000)->nullable(); $table->integer('type'); $table->string('options', 500); $table->timestamps(); $table->foreign('user_id') ->references('id')->on('users') ->onDelete('cascade'); }); - Schema::create('participants', function (Blueprint $table) { $table->id(); $table->foreignId('poll_id'); $table->string('name'); $table->integer('invitation_id')->nullable(); $table->boolean('invited')->default(false); $table->boolean('receive_comment_reminder')->default(false); $table->boolean('show_admin_only')->default(false); $table->foreignId('user_id')->nullable(); $table->string('comment', 1000)->nullable(); $table->smallInteger('guests')->default(0); $table->smallInteger('choice')->default(-1); $table->timestamps(); $table->foreign('user_id') ->references('id')->on('users') ->onDelete('set null') ; $table->foreign('poll_id') ->references('id')->on('polls') ->onDelete('cascade') ; });