20211119021951_create_order_goods_package_table.php 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. use think\migration\Migrator;
  3. use think\migration\db\Column;
  4. class CreateOrderGoodsPackageTable extends Migrator
  5. {
  6. /**
  7. * Change Method.
  8. *
  9. * Write your reversible migrations using this method.
  10. *
  11. * More information on writing migrations is available here:
  12. * http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
  13. *
  14. * The following commands can be used in this method and Phinx will
  15. * automatically reverse them when rolling back:
  16. *
  17. * createTable
  18. * renameTable
  19. * addColumn
  20. * renameColumn
  21. * addIndex
  22. * addForeignKey
  23. *
  24. * Remember to call "create()" or "update()" and NOT "save()" when working
  25. * with the Table class.
  26. */
  27. public function change()
  28. {
  29. $this->table('order_goods_package',array('id' => true,'primary_key' => ['id'],'engine'=>'InnoDB','comment'=>'订单商品拆分包裹表'))
  30. ->addColumn('order_goods_id', 'integer',array('limit' => 11,'signed'=>false,'default'=>0,'comment'=>'订单商品ID'))
  31. ->addColumn('user_id', 'integer',array('limit' => 11,'signed'=>false,'default'=>0,'comment'=>'用户id'))
  32. ->addColumn('order_id', 'integer',array('limit' => 11,'signed'=>false,'default'=>0,'comment'=>'订单id'))
  33. ->addColumn('goods_id', 'integer',array('limit' => 11,'signed'=>false,'default'=>0,'comment'=>'商品ID'))
  34. ->addColumn('total_num', 'integer',array('limit' => 11,'signed'=>false,'default'=>0,'comment'=>'商品数量'))
  35. ->addColumn('express_id', 'integer',array('limit' => 11,'signed'=>false,'default'=>0,'comment'=>'物流公司id'))
  36. ->addColumn('express_company', 'string',array('limit' => 50,'default'=>'','comment'=>'物流公司'))
  37. ->addColumn('express_no', 'string',array('limit' => 50,'default'=>'','comment'=>'物流单号'))
  38. ->addColumn('is_sign', 'integer',array('limit' => 11,'default'=>0,'comment'=>'签收状态 1已签收 0未签收'))
  39. ->addColumn('delivery_status', 'integer',array('limit' => 11,'default'=>10,'comment'=>'发货状态(10未发货 20已发货)'))
  40. ->addColumn('delivery_time', 'datetime',array('null' => true,'comment'=>'发货时间'))
  41. ->addColumn('receipt_status', 'integer',array('limit' => 11,'default'=>10,'comment'=>'收货状态(10未收货 20已收货)'))
  42. ->addColumn('receipt_time', 'datetime',array('null' => true,'comment'=>'收货时间'))
  43. ->addColumn('sign_time', 'datetime',array('null' => true,'comment'=>'签收时间'))
  44. ->addColumn('create_time', 'datetime', array('null' => true,'comment'=>'创建时间'))
  45. ->addColumn('update_time', 'datetime', array('null' => true,'comment'=>'更新时间'))
  46. ->create();
  47. }
  48. }