<?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_introduce_logs', function (Blueprint $table) {
            $table->id();
            $table->integer('order_id')->nullable()->unsigned()->comment("订单id");
            $table->decimal('amount',7)->default(0)->comment("收益金额");
            $table->integer('introduce_order_id')->unsigned()->comment("介绍人订单id");
            $table->enum('type', ["INTRODUCE", "SIGNIN", "REFUND"])->nullable()->comment("类型，INTRODUCE:介绍，SIGNIN:签到");
            $table->timestamps();
        });
    }

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