table('order') ->changeColumn('delivery_type', 'integer', array('limit' => 3, 'default' => 10, 'comment' => '配送方式(10快递配送 20门店自提)')) ->addColumn('hx_status', 'integer', array('limit' => 3, 'default' => 10, 'comment' => '核销状态(10未核销 20已核销)')) ->addColumn('hx_user_id', 'integer', array('limit' => 11, 'default' => 0, 'comment' => '核销人用户ID')) ->addColumn('hx_code', 'string', array('limit' => 100, 'default' => '', 'comment' => '核销码')) ->addColumn('pickup_time', 'integer', array('limit' => 11, 'default' => 0, 'comment' => '提货时间')) ->addColumn('pickup_deadline', 'integer', array('limit' => 11, 'default' => 0, 'comment' => '提货截止时间')) ->addColumn('shop_id', 'integer', array('limit' => 11, 'default' => 0, 'comment' => '订单自提门店id')) // ->addIndex(['hx_code'], ['unique' => true]) 由于核销码可以为空 所以没法增加唯一索引 ->save(); } }