M250513101331UpdateDiyPageUrlData.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. namespace app\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M250513101331UpdateDiyPageUrlData
  6. */
  7. class M250513101331UpdateDiyPageUrlData extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $sql = <<<SQL
  15. update qimall_diy_page set content=REPLACE(content, 'plugins8/Clinic', 'customDesigns/Clinic');
  16. update qimall_diy_page set content=REPLACE(content, 'plugins8/Farm', 'customAddons/Farm');
  17. update qimall_diy_page set content=REPLACE(content, 'plugins8/LaoDaFu', 'customDesigns/LaoDaFu');
  18. update qimall_diy_page set content=REPLACE(content, 'plugins8/MakerCar', 'customAddons/MakerCar');
  19. update qimall_diy_page set content=REPLACE(content, 'plugins8/ScoreGame', 'customAddons/ScoreGame');
  20. update qimall_diy_page set content=REPLACE(content, 'plugins8/TestReportFile', 'customAddons/TestReportFile');
  21. update qimall_addons_marketing_setting set content=REPLACE(content, 'plugins8/Clinic', 'customDesigns/Clinic');
  22. update qimall_addons_marketing_setting set content=REPLACE(content, 'plugins8/Farm', 'customAddons/Farm');
  23. update qimall_addons_marketing_setting set content=REPLACE(content, 'plugins8/LaoDaFu', 'customDesigns/LaoDaFu');
  24. update qimall_addons_marketing_setting set content=REPLACE(content, 'plugins8/MakerCar', 'customAddons/MakerCar');
  25. update qimall_addons_marketing_setting set content=REPLACE(content, 'plugins8/ScoreGame', 'customAddons/ScoreGame');
  26. update qimall_addons_marketing_setting set content=REPLACE(content, 'plugins8/TestReportFile', 'customAddons/TestReportFile');
  27. SQL;
  28. $this->execute($sql);
  29. }
  30. /**
  31. * {@inheritdoc}
  32. */
  33. public function safeDown()
  34. {
  35. return false;
  36. }
  37. /*
  38. // Use up()/down() to run migration code without a transaction.
  39. public function up()
  40. {
  41. }
  42. public function down()
  43. {
  44. echo "M250513101331UpdateDiyPageUrlData cannot be reverted.\n";
  45. return false;
  46. }
  47. */
  48. }