<?php

use yii\db\Migration;

/**
 * Class m191112_015939_create_table_delivery
 */
class m191112_015939_create_table_delivery extends Migration
{
    /**
     * {@inheritdoc}
     */
    public function up()
    {
        $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB COMMENT="物流表"';
        $this->createTable('ats_delivery', [
            'id' => $this->primaryKey(),
            'order_id'=>$this->integer(11)->defaultValue(null)->comment('订单id'),
            'shipping_name'=>$this->string(50)->defaultValue(null)->comment('货流名称'),
            'shipping_id'=>$this->string(10)->defaultValue(null)->comment('运货单位'),
            'type'=>$this->tinyInteger(1)->defaultValue(0)->comment('类型'),
            'goods'=>$this->text()->comment('商品'),
            'status'=>$this->tinyInteger(1)->defaultValue(0)->comment('状态'),
            'decription'=>$this->text()->comment('描述'),
            'updated_at'=>$this->integer(11)->defaultValue(null)->comment('更新时间'),
            'created_at'=>$this->integer(11)->defaultValue(null)->comment('创建时间'),
        ],$tableOptions);
    }

    /**
     * {@inheritdoc}
     */
    public function down()
    {
        $this->dropTable('ats_delivery');
        return true;
    }
}