M241015024554CreateCloudStockAgentCartTable.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. namespace addons\CloudStock\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Handles the creation of table `{{%cloud_stock_agent_cart}}`.
  6. */
  7. class M241015024554CreateCloudStockAgentCartTable extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $sql = <<<SQL
  15. CREATE TABLE `qimall_addons_cloud_stock_agent_cart` (
  16. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  17. `mall_id` int(10) unsigned NOT NULL DEFAULT '0',
  18. `user_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '用户id',
  19. `goods_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '商品id',
  20. `order_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '提交订单后的订单id',
  21. `num` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '件数',
  22. `status` tinyint(4) NOT NULL DEFAULT '1' COMMENT '状态[-1:删除;0:禁用;1启用]',
  23. `created_at` int(10) unsigned NOT NULL DEFAULT '0',
  24. `updated_at` int(10) unsigned NOT NULL DEFAULT '0',
  25. PRIMARY KEY (`id`),
  26. KEY `mall_id` (`mall_id`,`user_id`)
  27. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='代理批量提货购物车';
  28. SQL;
  29. $this->execute($sql);
  30. }
  31. /**
  32. * {@inheritdoc}
  33. */
  34. public function safeDown()
  35. {
  36. return false;
  37. }
  38. }