M240929095823AddColumnCategoryWwitchToStore.php 720 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace addons\Store\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M240929095823AddColumnCategoryWwitchToStore
  6. */
  7. class M240929095823AddColumnCategoryWwitchToStore extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $sql = <<<SQL
  15. ALTER TABLE `qimall_addons_store`
  16. ADD COLUMN `store_category_switch` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '门店分类开关' AFTER `default_store_cate_style`;
  17. SQL;
  18. $this->execute($sql);
  19. }
  20. /**
  21. * {@inheritdoc}
  22. */
  23. public function safeDown()
  24. {
  25. echo "M240929095823AddColumnCategoryWwitchToStore cannot be reverted.\n";
  26. return false;
  27. }
  28. }