M240123121412AreaCommunityAddFieldParentIsDistrict.php 939 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. namespace addons\Area\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M240123121412AreaCommunityAddFieldParentIsDistrict
  6. */
  7. class M240123121412AreaCommunityAddFieldParentIsDistrict extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $this->execute("ALTER TABLE `qimall_addons_area_community` ADD COLUMN `parent_is_district` TINYINT NOT NULL DEFAULT 0 COMMENT '上级是否为区级' AFTER `area`;");
  15. }
  16. /**
  17. * {@inheritdoc}
  18. */
  19. public function safeDown()
  20. {
  21. echo "M240123121412AreaCommunityAddFieldParentIsDistrict cannot be reverted.\n";
  22. return false;
  23. }
  24. /*
  25. // Use up()/down() to run migration code without a transaction.
  26. public function up()
  27. {
  28. }
  29. public function down()
  30. {
  31. echo "M240123121412AreaCommunityAddFieldParentIsDistrict cannot be reverted.\n";
  32. return false;
  33. }
  34. */
  35. }