| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- <?php
- namespace addons\Store\console\migrations;
- use yii\db\Migration;
- /**
- * Class M250902104649InsertQimallLinkCategory
- */
- class M250902104649InsertQimallLinkCategory extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- $sql = "select * from qimall_link_category where name = 'store_steward' and pid = 0";
- $list = \Yii::$app->db->createCommand($sql)->queryAll();
- if ($list) {
- $sql = "update `qimall_link_category` set `name` = 'store_commodity_cate' where `name` = 'store-commodity-cate' and `pid` = ".$list[0]['id'].";";
- $this->execute($sql);
- }
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M250902104649InsertQimallLinkCategory cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M250726084649InsertQimallLinkCategory cannot be reverted.\n";
- return false;
- }
- */
- }
|