| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- <?php
- namespace app\migrations;
- use yii\db\Migration;
- /**
- *
- * Class M221230065148UpdateContentToDiy
- */
- class M221230065148UpdateContentToDiy extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- $sql = "set @old_url = '/plugins/Store/';
- set @new_url = '/plugins2/Store/';
- UPDATE `qimall_diy_page` SET content=REPLACE(content, @old_url, @new_url) where content like concat(\"%\",@old_url,\"%\");
- UPDATE qimall_addons_marketing_setting set content=REPLACE(content, @old_url, @new_url) where content like concat(\"%\",@old_url,\"%\");";
- $this->execute($sql);
- $sql = "set @old_url = '/plugins/Card/';
- set @new_url = '/plugins2/Card/';
- UPDATE `qimall_diy_page` SET content=REPLACE(content, @old_url, @new_url) where content like concat(\"%\",@old_url,\"%\");
- UPDATE qimall_addons_marketing_setting set content=REPLACE(content, @old_url, @new_url) where content like concat(\"%\",@old_url,\"%\");";
- $this->execute($sql);
- $sql = "set @old_url = '/plugins/Pk/';
- set @new_url = '/plugins2/Pk/';
- UPDATE `qimall_diy_page` SET content=REPLACE(content, @old_url, @new_url) where content like concat(\"%\",@old_url,\"%\");
- UPDATE qimall_addons_marketing_setting set content=REPLACE(content, @old_url, @new_url) where content like concat(\"%\",@old_url,\"%\");";
- $this->execute($sql);
- $sql = "set @old_url = '/plugins/ElectronCoupon/';
- set @new_url = '/plugins2/ElectronCoupon/';
- UPDATE `qimall_diy_page` SET content=REPLACE(content, @old_url, @new_url) where content like concat(\"%\",@old_url,\"%\");
- UPDATE qimall_addons_marketing_setting set content=REPLACE(content, @old_url, @new_url) where content like concat(\"%\",@old_url,\"%\");";
- $this->execute($sql);
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M221230065148UpdateContentToDiy cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M221230065148UpdateContentToDiy cannot be reverted.\n";
- return false;
- }
- */
- }
|