M250616163010AlterTableAddonsBusinessBonusUpgradeCondition.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. namespace addons\BusinessBonus\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M250616163010AlterTableAddonsBusinessBonusUpgradeCondition
  6. */
  7. class M250616163010AlterTableAddonsBusinessBonusUpgradeCondition extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. try {
  15. $sql = <<<EOF
  16. ALTER TABLE `qimall_addons_business_bonus_upgrade_condition`
  17. ADD COLUMN `is_condition_upgrade` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否开启条件升级:0否 1是',
  18. ADD COLUMN `checked_condition_values` longtext NOT NULL COMMENT '升级条件',
  19. ADD COLUMN `checked_condition_keys` text COMMENT '升级条件选中的key集合',
  20. ADD COLUMN `is_buy_goods_upgrade` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否开启购物升级:0否 1是',
  21. ADD COLUMN `buy_goods_upgrade_type` tinyint(1) NOT NULL DEFAULT '1' COMMENT '购物升级类型:1购买平台商品 2购买门店商品',
  22. ADD COLUMN `buy_goods_upgrade_method` tinyint(1) NOT NULL DEFAULT '1' COMMENT '购物升级方法:1任意商品 2指定商品';
  23. EOF;
  24. $this->execute($sql);
  25. } catch (\Exception $e) {
  26. }
  27. }
  28. /**
  29. * {@inheritdoc}
  30. */
  31. public function safeDown()
  32. {
  33. echo "M250616163010AlterTableAddonsBusinessBonusUpgradeCondition cannot be reverted.\n";
  34. return false;
  35. }
  36. }