| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?php
- namespace addons\BusinessBonus\console\migrations;
- use yii\db\Migration;
- /**
- * Class M250616163010AlterTableAddonsBusinessBonusUpgradeCondition
- */
- class M250616163010AlterTableAddonsBusinessBonusUpgradeCondition extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- try {
- $sql = <<<EOF
- ALTER TABLE `qimall_addons_business_bonus_upgrade_condition`
- ADD COLUMN `is_condition_upgrade` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否开启条件升级:0否 1是',
- ADD COLUMN `checked_condition_values` longtext NOT NULL COMMENT '升级条件',
- ADD COLUMN `checked_condition_keys` text COMMENT '升级条件选中的key集合',
- ADD COLUMN `is_buy_goods_upgrade` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否开启购物升级:0否 1是',
- ADD COLUMN `buy_goods_upgrade_type` tinyint(1) NOT NULL DEFAULT '1' COMMENT '购物升级类型:1购买平台商品 2购买门店商品',
- ADD COLUMN `buy_goods_upgrade_method` tinyint(1) NOT NULL DEFAULT '1' COMMENT '购物升级方法:1任意商品 2指定商品';
- EOF;
- $this->execute($sql);
- } catch (\Exception $e) {
- }
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M250616163010AlterTableAddonsBusinessBonusUpgradeCondition cannot be reverted.\n";
- return false;
- }
- }
|