M241204031643CreateCouponStoreGoodsRelateTable.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. namespace addons\Coupon\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Handles the creation of table `{{%coupon_store_goods_relate}}`.
  6. */
  7. class M241204031643CreateCouponStoreGoodsRelateTable extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $sql = <<<SQL
  15. CREATE TABLE `qimall_addons_coupon_store_goods_relate` (
  16. `id` int(11) NOT NULL AUTO_INCREMENT,
  17. `mall_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '商城ID',
  18. `status` tinyint(4) NOT NULL DEFAULT '1' COMMENT '状态[-1:删除;0:禁用;1启用]',
  19. `coupon_id` int(11) NOT NULL COMMENT '优惠券id',
  20. `goods_id` int(11) NOT NULL COMMENT '门店商品id',
  21. `created_at` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
  22. `updated_at` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
  23. PRIMARY KEY (`id`) USING BTREE
  24. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='门店商品优惠券表';
  25. SQL;
  26. $this->execute($sql);
  27. }
  28. /**
  29. * {@inheritdoc}
  30. */
  31. public function safeDown()
  32. {
  33. return false;
  34. }
  35. }