M241108091651UpdateQimallAddonsSetting.php 974 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. namespace app\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M241108091651UpdateQimallAddonsSetting
  6. */
  7. class M241108091651UpdateQimallAddonsSetting extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. try {
  15. $sql = <<<SQL
  16. UPDATE `qimall_addons_setting` SET `group` = 'scoreGive' WHERE `addons_name` = 'Store' AND `name` IN ('score_give_setting', 'score_give_is_store_alone');
  17. SQL;
  18. $this->execute($sql);
  19. }catch (\Exception $exception){}
  20. }
  21. /**
  22. * {@inheritdoc}
  23. */
  24. public function safeDown()
  25. {
  26. echo "M241108091651UpdateQimallAddonsSetting cannot be reverted.\n";
  27. return false;
  28. }
  29. /*
  30. // Use up()/down() to run migration code without a transaction.
  31. public function up()
  32. {
  33. }
  34. public function down()
  35. {
  36. echo "M241108091651UpdateQimallAddonsSetting cannot be reverted.\n";
  37. return false;
  38. }
  39. */
  40. }