<?php

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

class CreatePartnerCommissionsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('partner_commissions', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('order_id')->comment('订单id');
            $table->integer('partner_id')->comment('合伙人id');
            $table->decimal('amount',7,2)->comment('佣金金额');
            $table->string('status')->default(0)->comment('状态,0冻结,1已入账');
            $table->timestamp('unfreeze_time')->comment('佣金解冻时间');
            $table->timestamps();

            $table->comment('合伙人-佣金表');
        });
    }

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