| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <?php
- namespace addons\Coupon\console\migrations;
- use addons\Coupon\common\models\AddonsCouponUserRelate;
- use yii\db\Migration;
- /**
- * Class M231212062704AlterQimallAddonsCouponUserRelate
- */
- class M231212062704AlterQimallAddonsCouponUserRelate extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- $this->execute("alter table qimall_addons_coupon_user_relate add `mch_id` varchar(3000) not null default ''");
- $this->execute("UPDATE `qimall_addons_coupon` set `mch_id` = '' where `mch_id` = '0';");
- AddonsCouponUserRelate::fixMchId();
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M231212062704AlterQimallAddonsCouponUserRelate cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M231212062704AlterQimallAddonsCouponUserRelate cannot be reverted.\n";
- return false;
- }
- */
- }
|