diff --git a/database/migrations/create_events_table.php.stub b/database/migrations/create_events_table.php.stub index e526b02..8aaa85d 100644 --- a/database/migrations/create_events_table.php.stub +++ b/database/migrations/create_events_table.php.stub @@ -1,6 +1,7 @@ date('end_date'); $table->boolean('registration_form'); $table->foreignId('image_id')->nullable(); - $table->json('status'); - $table->json('title'); - $table->json('slug'); - $table->json('venue'); - $table->json('address'); - $table->json('summary'); - $table->json('body'); - $table->json('website'); + $table->json('status')->default(new Expression('(JSON_OBJECT())')); + $table->json('title')->default(new Expression('(JSON_OBJECT())')); + $table->json('slug')->default(new Expression('(JSON_OBJECT())')); + $table->json('venue')->default(new Expression('(JSON_OBJECT())')); + $table->json('address')->default(new Expression('(JSON_OBJECT())')); + $table->json('summary')->default(new Expression('(JSON_OBJECT())')); + $table->json('body')->default(new Expression('(JSON_OBJECT())')); + $table->json('website')->default(new Expression('(JSON_OBJECT())')); $table->timestamps(); }); } diff --git a/database/migrations/create_registrations_table.php.stub b/database/migrations/create_registrations_table.php.stub index 72f1181..59ed7ec 100644 --- a/database/migrations/create_registrations_table.php.stub +++ b/database/migrations/create_registrations_table.php.stub @@ -13,7 +13,7 @@ class CreateRegistrationsTable extends Migration { Schema::create('registrations', function (Blueprint $table) { $table->id(); - $table->foreignId('event_id'); + $table->foreignId('event_id')->constrained(); $table->foreignId('user_id')->nullable(); $table->unsignedInteger('number_of_people'); $table->string('email')->nullable(); @@ -22,7 +22,6 @@ class CreateRegistrationsTable extends Migration $table->string('locale')->nullable(); $table->text('message')->nullable(); $table->timestamps(); - $table->foreign('event_id')->references('id')->on('events'); }); }