M250823035353CreateQimallAddonsCloudStockGiveCouponSetting.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. namespace addons\CloudStock\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M250823035353CreateQimallAddonsCloudStockGiveCouponSetting
  6. */
  7. class M250823035353CreateQimallAddonsCloudStockGiveCouponSetting extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $sql = "CREATE TABLE `qimall_addons_cloud_stock_give_coupon_setting` (
  15. `id` int(11) NOT NULL AUTO_INCREMENT,
  16. `mall_id` int(11) NOT NULL COMMENT '商城ID',
  17. `goods_id` int(11) DEFAULT '0' COMMENT '设置id',
  18. `level` int(10) DEFAULT '0' COMMENT '等级权重',
  19. `coupon_setting` text COMMENT '赠送规则',
  20. `num` int(11) DEFAULT '0' COMMENT '满*赠送',
  21. `status` tinyint(1) DEFAULT '1' COMMENT '状态[-1:删除;0:禁用;1启用]',
  22. `created_at` int(11) NOT NULL DEFAULT '0',
  23. `updated_at` int(11) NOT NULL DEFAULT '0',
  24. PRIMARY KEY (`id`) USING BTREE,
  25. KEY `mall_id` (`mall_id`) USING BTREE
  26. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='云库存补货赠送优惠券设置详情'";
  27. $this->execute($sql);
  28. }
  29. /**
  30. * {@inheritdoc}
  31. */
  32. public function safeDown()
  33. {
  34. echo "M250823035353CreateQimallAddonsCloudStockGiveCouponSetting cannot be reverted.\n";
  35. return false;
  36. }
  37. /*
  38. // Use up()/down() to run migration code without a transaction.
  39. public function up()
  40. {
  41. }
  42. public function down()
  43. {
  44. echo "M250823035353CreateQimallAddonsCloudStockGiveCouponSetting cannot be reverted.\n";
  45. return false;
  46. }
  47. */
  48. }