| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- <?php
- namespace addons\Store\console\migrations;
- use yii\db\Migration;
- /**
- * Class M230222023350AlterMallIdToAddonsStoreCouponMemberRelate
- */
- class M230222023350AlterMallIdToAddonsStoreCouponMemberRelate extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- $res = \Yii::$app->db->schema->getTableSchema("qimall_addons_store_coupon_member_relate", true);
- if (!$res->getColumn('mall_id')) {
- $sql = "ALTER TABLE `qimall_addons_store_coupon_member_relate` ADD COLUMN `mall_id` int(11) NOT NULL DEFAULT '0' COMMENT '商城ID';";
- $this->execute($sql);
- }
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M230222023350AlterMallIdToAddonsStoreCouponMemberRelate cannot be reverted.\n";
- return false;
- }
- */
- }
|