diff options
| author | horus | 2020-03-05 16:02:10 +0100 |
|---|---|---|
| committer | horus | 2020-03-05 16:02:10 +0100 |
| commit | 5dda561d73c9a5698386d643d56a142aa4bbdeec (patch) | |
| tree | 55afe2db98d0fa15fc845cc3da3afe6b517bbd3d /database | |
| parent | 420e44e0fe4623a439e26dfd0526ee5ef606a170 (diff) | |
| download | senpai-5dda561d73c9a5698386d643d56a142aa4bbdeec.tar.gz | |
Committing intermediate state.
Diffstat (limited to 'database')
9 files changed, 289 insertions, 28 deletions
diff --git a/database/migrations/2020_02_23_235746_create_anime_table.php b/database/migrations/2020_02_23_235746_create_anime_table.php index 985812e..f2df40f 100644 --- a/database/migrations/2020_02_23_235746_create_anime_table.php +++ b/database/migrations/2020_02_23_235746_create_anime_table.php @@ -21,12 +21,13 @@ class CreateAnimeTable extends Migration $table->string('url')->default(''); $table->string('image_url')->default(''); - $table->string('title_eng')->default(''); - $table->string('title_rom')->default(''); - $table->string('title_nat')->default(''); - $table->string('title_pref')->default(''); + $table->string('title_eng')->default('')->nullable(); + $table->string('title_rom')->default('')->nullable(); + $table->string('title_nat')->default('')->nullable(); + $table->string('title_pref')->default('')->nullable(); - $table->string('type')->default(''); + $table->string('anime_type')->default('')->nullable(); + $table->string('broadcasted')->default('')->nullable(); $table->timestamps(); }); diff --git a/database/migrations/2020_02_23_235949_create_stats_table.php b/database/migrations/2020_02_23_235949_create_stats_table.php index 142374c..5516789 100644 --- a/database/migrations/2020_02_23_235949_create_stats_table.php +++ b/database/migrations/2020_02_23_235949_create_stats_table.php @@ -21,29 +21,29 @@ class CreateStatsTable extends Migration $table->string('season_name')->default(''); $table->integer('season_year')->default(0); - $table->float('score')->default(0); - $table->integer('scored_by')->default(0); - $table->integer('rank')->default(0); - $table->integer('popularity')->default(0); - $table->integer('members')->default(0); - $table->integer('favorites')->default(0); - - $table->integer('watching')->default(0); - $table->integer('completed')->default(0); - $table->integer('onhold')->default(0); - $table->integer('dropped')->default(0); - $table->integer('plan_to_watch')->default(0); - - $table->integer('score_1')->default(0); - $table->integer('score_2')->default(0); - $table->integer('score_3')->default(0); - $table->integer('score_4')->default(0); - $table->integer('score_5')->default(0); - $table->integer('score_6')->default(0); - $table->integer('score_7')->default(0); - $table->integer('score_8')->default(0); - $table->integer('score_9')->default(0); - $table->integer('score_10')->default(0); + $table->float('score')->default(0)->nullable(); + $table->integer('scored_by')->default(0)->nullable(); + $table->integer('rank')->default(0)->nullable(); + $table->integer('popularity')->default(0)->nullable(); + $table->integer('members')->default(0)->nullable(); + $table->integer('favorites')->default(0)->nullable(); + + $table->integer('watching')->default(0)->nullable(); + $table->integer('completed')->default(0)->nullable(); + $table->integer('onhold')->default(0)->nullable(); + $table->integer('dropped')->default(0)->nullable(); + $table->integer('plan_to_watch')->default(0)->nullable(); + + $table->integer('score_1')->default(0)->nullable(); + $table->integer('score_2')->default(0)->nullable(); + $table->integer('score_3')->default(0)->nullable(); + $table->integer('score_4')->default(0)->nullable(); + $table->integer('score_5')->default(0)->nullable(); + $table->integer('score_6')->default(0)->nullable(); + $table->integer('score_7')->default(0)->nullable(); + $table->integer('score_8')->default(0)->nullable(); + $table->integer('score_9')->default(0)->nullable(); + $table->integer('score_10')->default(0)->nullable(); $table->timestamps(); }); diff --git a/database/migrations/2020_02_27_185936_create_airing_table.php b/database/migrations/2020_02_27_185936_create_airing_table.php new file mode 100644 index 0000000..efc0a1d --- /dev/null +++ b/database/migrations/2020_02_27_185936_create_airing_table.php @@ -0,0 +1,35 @@ +<?php + +use Illuminate\Database\Migrations\Migration; +use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; + +class CreateAiringTable extends Migration +{ + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + Schema::create('airing', function (Blueprint $table) { + $table->bigIncrements('id'); + $table->timestamps(); + + $table->unsignedBigInteger('mal_id')->default(0); + $table->integer('episode')->default(0); + $table->dateTime('aired_at'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('airing'); + } +} diff --git a/database/migrations/2020_02_27_190422_add_fk_airing.php b/database/migrations/2020_02_27_190422_add_fk_airing.php new file mode 100644 index 0000000..24de5cb --- /dev/null +++ b/database/migrations/2020_02_27_190422_add_fk_airing.php @@ -0,0 +1,32 @@ +<?php + +use Illuminate\Database\Migrations\Migration; +use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; + +class AddFkAiring extends Migration +{ + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + Schema::table('airing', function (Blueprint $table) { + $table->foreign('mal_id')->references('mal_id')->on('anime'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('airing', function (Blueprint $table) { + // + }); + } +} diff --git a/database/migrations/2020_03_01_151652_create_malusers.php b/database/migrations/2020_03_01_151652_create_malusers.php new file mode 100644 index 0000000..cd55278 --- /dev/null +++ b/database/migrations/2020_03_01_151652_create_malusers.php @@ -0,0 +1,34 @@ +<?php + +use Illuminate\Database\Migrations\Migration; +use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; + +class CreateMalusers extends Migration +{ + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + Schema::create('malusers', function (Blueprint $table) { + $table->bigIncrements('id'); + + $table->string('username')->unique()->default(''); + + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('malusers'); + } +} diff --git a/database/migrations/2020_03_01_152954_create_is_watching.php b/database/migrations/2020_03_01_152954_create_is_watching.php new file mode 100644 index 0000000..30c5bd6 --- /dev/null +++ b/database/migrations/2020_03_01_152954_create_is_watching.php @@ -0,0 +1,42 @@ +<?php + +use Illuminate\Database\Migrations\Migration; +use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; + +class CreateIsWatching extends Migration +{ + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + Schema::create('is_watching', function (Blueprint $table) { + $table->bigIncrements('id'); + + $table->unsignedBigInteger('mal_id')->default(0); + $table->unsignedBigInteger('user_id')->default(0); + + $table->integer('episodes_watched')->nullable()->default(0); + $table->float('score_user')->nullable()->default(0); + + $table->unique( ['mal_id', 'user_id'] ); + $table->foreign('mal_id')->references('mal_id')->on('anime'); + $table->foreign('user_id')->references('id')->on('malusers'); + + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('is_watching'); + } +} diff --git a/database/migrations/2020_03_05_004655_add_duration_to_airing.php b/database/migrations/2020_03_05_004655_add_duration_to_airing.php new file mode 100644 index 0000000..4b3c992 --- /dev/null +++ b/database/migrations/2020_03_05_004655_add_duration_to_airing.php @@ -0,0 +1,33 @@ +<?php + +use Illuminate\Database\Migrations\Migration; +use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; + +class AddDurationToAiring extends Migration +{ + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + Schema::table('airing', function (Blueprint $table) { + $table->integer('duration')->default(0); + $table->unique(['mal_id', 'episode']); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('airing', function (Blueprint $table) { + // + }); + } +} diff --git a/database/migrations/2020_03_05_011440_add_episodes_to_anime.php b/database/migrations/2020_03_05_011440_add_episodes_to_anime.php new file mode 100644 index 0000000..948a84e --- /dev/null +++ b/database/migrations/2020_03_05_011440_add_episodes_to_anime.php @@ -0,0 +1,32 @@ +<?php + +use Illuminate\Database\Migrations\Migration; +use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; + +class AddEpisodesToAnime extends Migration +{ + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + Schema::table('anime', function (Blueprint $table) { + $table->integer('episodes')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('anime', function (Blueprint $table) { + // + }); + } +} diff --git a/database/migrations/2020_03_05_162010_create_calendar.php b/database/migrations/2020_03_05_162010_create_calendar.php new file mode 100644 index 0000000..3a6cb8f --- /dev/null +++ b/database/migrations/2020_03_05_162010_create_calendar.php @@ -0,0 +1,52 @@ +<?php + +use Illuminate\Database\Migrations\Migration; +use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; + +class CreateCalendar extends Migration +{ + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + Schema::create('calendar', function (Blueprint $table) { + $table->bigIncrements('id'); + + $table->unsignedBigInteger('mal_id')->default(0); + $table->unsignedBigInteger('user_id')->default(0); + + $table->string('username')->default(''); + $table->timestamp('airing_at'); + $table->integer('duration')->default('20'); + $table->integer('episode')->default(0); + $table->integer('episodes_watched')->default(0)->nullable(); + $table->integer('episodes_complete')->default(0)->nullable(); + $table->float('score')->default(0)->nullable(); + $table->integer('score_user')->default(0)->nullable(); + $table->string('mal_url')->default(''); + $table->string('title')->default(''); + + $table->foreign('mal_id')->references('mal_id')->on('anime'); + $table->foreign('user_id')->references('id')->on('malusers'); + + $table->unique(['mal_id', 'user_id', 'airing_at']); + $table->unique(['mal_id', 'user_id', 'episode']); + + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('calendar'); + } +} |
