summaryrefslogtreecommitdiff
path: root/database/migrations/2020_02_23_235949_create_stats_table.php
blob: 55167899249582d6434eab76a22691eda4b04478 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateStatsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('stats', function (Blueprint $table) {
            $table->bigIncrements('id');

	    $table->unsignedBigInteger('mal_id')->default(0);

            $table->string('season_name')->default('');
            $table->integer('season_year')->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();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('stats');
    }
}