1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <?php
- use think\migration\Migrator;
- use think\migration\db\Column;
- class CreateOrderGoodsPackageTable extends Migrator
- {
- /**
- * Change Method.
- *
- * Write your reversible migrations using this method.
- *
- * More information on writing migrations is available here:
- * http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
- *
- * The following commands can be used in this method and Phinx will
- * automatically reverse them when rolling back:
- *
- * createTable
- * renameTable
- * addColumn
- * renameColumn
- * addIndex
- * addForeignKey
- *
- * Remember to call "create()" or "update()" and NOT "save()" when working
- * with the Table class.
- */
- public function change()
- {
- $this->table('order_goods_package',array('id' => true,'primary_key' => ['id'],'engine'=>'InnoDB','comment'=>'订单商品拆分包裹表'))
- ->addColumn('order_goods_id', 'integer',array('limit' => 11,'signed'=>false,'default'=>0,'comment'=>'订单商品ID'))
- ->addColumn('user_id', 'integer',array('limit' => 11,'signed'=>false,'default'=>0,'comment'=>'用户id'))
- ->addColumn('order_id', 'integer',array('limit' => 11,'signed'=>false,'default'=>0,'comment'=>'订单id'))
- ->addColumn('goods_id', 'integer',array('limit' => 11,'signed'=>false,'default'=>0,'comment'=>'商品ID'))
- ->addColumn('total_num', 'integer',array('limit' => 11,'signed'=>false,'default'=>0,'comment'=>'商品数量'))
- ->addColumn('express_id', 'integer',array('limit' => 11,'signed'=>false,'default'=>0,'comment'=>'物流公司id'))
- ->addColumn('express_company', 'string',array('limit' => 50,'default'=>'','comment'=>'物流公司'))
- ->addColumn('express_no', 'string',array('limit' => 50,'default'=>'','comment'=>'物流单号'))
- ->addColumn('is_sign', 'integer',array('limit' => 11,'default'=>0,'comment'=>'签收状态 1已签收 0未签收'))
- ->addColumn('delivery_status', 'integer',array('limit' => 11,'default'=>10,'comment'=>'发货状态(10未发货 20已发货)'))
- ->addColumn('delivery_time', 'datetime',array('null' => true,'comment'=>'发货时间'))
- ->addColumn('receipt_status', 'integer',array('limit' => 11,'default'=>10,'comment'=>'收货状态(10未收货 20已收货)'))
- ->addColumn('receipt_time', 'datetime',array('null' => true,'comment'=>'收货时间'))
- ->addColumn('sign_time', 'datetime',array('null' => true,'comment'=>'签收时间'))
- ->addColumn('create_time', 'datetime', array('null' => true,'comment'=>'创建时间'))
- ->addColumn('update_time', 'datetime', array('null' => true,'comment'=>'更新时间'))
- ->create();
- }
- }
|