<?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('activity_orders', function (Blueprint $table) {
            $table->id();
            $table->integer('activity_id')->comment('活动id');
            $table->integer('user_id')->comment('用户id');
            $table->string('trade_no')->comment('订单号');
            $table->string('sku')->comment('购买规格');
            $table->tinyInteger('is_pay')->default(0)->comment('是否支付 0:未支付 1:已支付');
            $table->integer('num')->comment('票券张数');
            $table->decimal('amount',7,2)->comment('支付金额');
            $table->integer('residue_amount')->comment('剩余金额');
            $table->integer('introduce_user_id')->nullable()->comment('介绍人id');
            $table->timestamps();
        });
    }

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