<?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('lotto_codes', function (Blueprint $table) {
            $table->id();
            $table->integer('user_id')->unsigned()->comment("用户id");
            $table->integer('order_id')->unsigned()->comment("订单id");
            $table->string('code',20)->comment("中奖码");
            $table->integer('member_id')->unsigned()->nullable()->comment("关联中奖用户");
            $table->string('title')->nullable()->comment("标题");
            $table->text('award')->nullable()->comment("中奖信息");
            $table->timestamps();
        });
    }

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