| 12345678910111213141516171819202122232425262728293031323334353637383940 |
- <?php
- namespace addons\Achievement\console\migrations;
- use yii\db\Migration;
- /**
- * 添加团长列表是否手动创建字段
- * Class M250505104636AlterTableAchievementUser
- */
- class M250505104636AlterTableAchievementUser extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- try {
- $sql =<<<SQL
- ALTER TABLE `qimall_addons_achievement_user`
- ADD COLUMN `is_manual` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否手动添加[1:是 0:否]' AFTER `status`;
- SQL;
- $this->execute($sql);
- }catch (\Exception $e) {
- \Yii::error($e->getMessage());
- }
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M250505104636AlterTableAchievementUser cannot be reverted.\n";
- return false;
- }
- }
|