<?php

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

class CreateBounsOrdersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('bouns_orders', function (Blueprint $table) {
            $table->id();
            $table->unsignedInteger('bouns_id');
            $table->morphs('order');
            $table->string('type', 20)->comment('类别');
            $table->unsignedDecimal('total', 12, 2)->default(0)->comment('订单金额');
            $table->unsignedDecimal('amount', 12, 2)->default(0)->comment('产生分红');
            $table->timestamps();
        });
    }

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