M250314082019AddRegion.php 980 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. namespace app\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M250314082019AddRegion
  6. */
  7. class M250314082019AddRegion extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. try {
  15. $sql = <<<SQL
  16. INSERT INTO `qimall_region` (`name`, `parent_id`, `level`, `short_title`, `areacode`, `zipcode`, `initial`, `lng`, `lat`) VALUES ('大亚湾经济技术开发区',2025,3,'',0,0,'D','114.52193199999','22.715671999999');
  17. INSERT INTO `qimall_region` (`name`, `parent_id`, `level`, `short_title`, `areacode`, `zipcode`, `initial`, `lng`, `lat`) VALUES ('仲恺高新技术产业开发区',2025,3,'',0,0,'Z','114.29527199999','23.034215000000');
  18. SQL;
  19. $this->execute($sql);
  20. } catch (\Exception $e) {
  21. }
  22. }
  23. /**
  24. * {@inheritdoc}
  25. */
  26. public function safeDown()
  27. {
  28. echo "M250314082019AddRegion cannot be reverted.\n";
  29. return false;
  30. }
  31. }