<?php

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

class CreateMagicwandsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('magicwands', function (Blueprint $table) {
            $table->id();
            $table->integer('link_id');
            $table->string('nano')->nullable();
            $table->string('sanhe')->nullable();
            $table->text('special_star')->nullable();
            $table->string('day_event')->nullable();
            $table->string('stone')->nullable();
            $table->integer('gogyo_0')->nullable();
            $table->integer('gogyo_1')->nullable();
            $table->integer('gogyo_2')->nullable();
            $table->integer('gogyo_3')->nullable();
            $table->integer('gogyo_4')->nullable();
            $table->integer('gogyo_z_0')->nullable();
            $table->integer('gogyo_z_1')->nullable();
            $table->integer('gogyo_z_2')->nullable();
            $table->integer('gogyo_z_3')->nullable();
            $table->integer('gogyo_z_4')->nullable();
            $table->timestamps();
        });

        Schema::create('lifes', function (Blueprint $table) {
            $table->id();
            $table->integer('magicwand_id');
            $table->string('content')->nullable();
            $table->string('life_time')->nullable();
            $table->string('rizhu')->nullable();
            $table->string('lunar')->nullable();
            $table->string('year')->nullable();
            $table->timestamps();
        });

        Schema::create('fortunes', function (Blueprint $table) {
            $table->id();
            $table->integer('magicwand_id');
            $table->string('year')->nullable();
            $table->string('zodiac')->nullable();
            $table->string('tong_yu')->nullable();
            $table->string('twelve')->nullable();
            $table->string('relationship')->nullable();
            $table->timestamps();
        });

        Schema::create('grand_fortunes', function (Blueprint $table) {
            $table->id();
            $table->integer('magicwand_id');
            $table->string('age')->nullable();
            $table->string('zodiac')->nullable();
            $table->string('tong_yu')->nullable();
            $table->string('twelve')->nullable();
            $table->string('relationship')->nullable();
            $table->timestamps();
        });

        Schema::create('date_results', function (Blueprint $table) {
            $table->id();
            $table->integer('magicwand_id');
            $table->string('content')->nullable();
            $table->string('hour_day')->nullable();
            $table->string('hour_month')->nullable();
            $table->string('hour_year')->nullable();
            $table->string('day_month')->nullable();
            $table->string('day_year')->nullable();
            $table->string('month_year')->nullable();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('magicwands');
        Schema::dropIfExists('lifes');
        Schema::dropIfExists('fortunes');
        Schema::dropIfExists('grand_fortunes');
        Schema::dropIfExists('date_results');
    }
}
