<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('pc_cao_history', function (Blueprint $table) {
            $table->id();
            $table->string('date')->unique()->comment('日期');
            $table->integer('total')->default(0)->comment('总期数');
            $table->integer('big')->default(0)->comment('大');
            $table->integer('small')->default(0)->comment('小');
            $table->integer('odd')->default(0)->comment('奇数');
            $table->integer('even')->default(0)->comment('偶数');

            $table->integer('big_odd')->default(0)->comment('大单');
            $table->integer('big_even')->default(0)->comment('大双');

            $table->integer('small_odd')->default(0)->comment('小单');
            $table->integer('small_even')->default(0)->comment('小双');

            $table->integer('max')->default(0)->comment('极大');
            $table->integer('min')->default(0)->comment('极小');

            $table->integer('pair')->default(0)->comment('对子');
            $table->integer('sequence')->default(0)->comment('顺子');
            $table->integer('leopard')->default(0)->comment('豹子');


            for ($i = 0; $i <= 27; $i++) {
                $table->integer("num_{$i}")->default(0)->comment("{$i}号");
            }


            $table->timestamps();
        });
    }

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