From 5dda561d73c9a5698386d643d56a142aa4bbdeec Mon Sep 17 00:00:00 2001 From: horus Date: Thu, 5 Mar 2020 16:02:10 +0100 Subject: Committing intermediate state. --- .../2020_03_01_152954_create_is_watching.php | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 database/migrations/2020_03_01_152954_create_is_watching.php (limited to 'database/migrations/2020_03_01_152954_create_is_watching.php') 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 @@ +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'); + } +} -- cgit v1.2.3