| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- <?php
- namespace addons\Store\console\migrations;
- use common\enums\RabbitMqEnum;
- use Yii;
- use yii\db\Migration;
- /**
- * Class M250726074810AlterQimallAddonsStoreGoodsCate
- */
- class M250726074810AlterQimallAddonsStoreGoodsCate extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- $sql = "ALTER TABLE `qimall_addons_store_goods_cate`
- ADD COLUMN `level` tinyint(1) NOT NULL DEFAULT 0 COMMENT '分类层级,从0开始';";
- $this->execute($sql);
- Yii::$app->services->rabbitMq->push(RabbitMqEnum::EXCHANGE_TASK, RabbitMqEnum::TASK_QUEUE, [], \addons\Store\common\models\StoreGoodsCate::class, 'migrateCateLevel');
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M250726074810AlterQimallAddonsStoreGoodsCate cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M250726074810AlterQimallAddonsStoreGoodsCate cannot be reverted.\n";
- return false;
- }
- */
- }
|