diff --git a/database/migrations/2018_08_17_102447_create_studios_table.php b/database/migrations/2018_08_17_102447_create_studios_table.php index 911eeac26..bf0b67474 100644 --- a/database/migrations/2018_08_17_102447_create_studios_table.php +++ b/database/migrations/2018_08_17_102447_create_studios_table.php @@ -17,18 +17,23 @@ public function up(): void { Schema::create(Studio::TABLE_NAME, function (Blueprint $table) { $table->id(); + $table->unsignedBigInteger('successor_id')->nullable(); $table->unsignedBigInteger('tv_rating_id')->nullable(); $table->unsignedInteger('mal_id')->nullable(); $table->unsignedTinyInteger('type'); $table->string('slug'); $table->string('name'); + $table->string('japanese_name')->nullable(); + $table->json('alternative_names')->nullable(); $table->mediumText('about')->nullable(); $table->mediumText('address')->nullable(); - $table->date('founded')->nullable(); + $table->json('social_urls')->nullable(); $table->json('website_urls')->nullable(); $table->boolean('is_nsfw')->default(false); $table->unsignedBigInteger('rank_total')->default(0); $table->integer('view_count')->default(0); + $table->date('founded_at')->nullable(); + $table->date('defunct_at')->nullable(); $table->timestamps(); $table->softDeletes(); }); @@ -43,6 +48,11 @@ public function up(): void $table->unique(['mal_id', 'type', 'name']); // Set foreign key constraints + $table->foreign('successor_id') + ->references('id') + ->on(Studio::TABLE_NAME) + ->nullOnDelete() + ->cascadeOnUpdate(); $table->foreign('tv_rating_id') ->references('id') ->on(TvRating::TABLE_NAME)