M241224145036AddStarRegion.php 987 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. namespace addons\StarChain\console\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M241224145036AddStarRegion
  6. */
  7. class M241224145036AddStarRegion extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. try {
  15. // 插入表数据
  16. $sql = <<<SQL
  17. INSERT INTO `qimall_addons_star_chain_region`(`region_id`, `name`, `city_code`, `region_code`, `parent_code`, `parent_name`, `region_full_name`, `region_full_codes`, `longitude`, `latitude`, `initial`, `region_level`) VALUES ('1526138588059811847', '临平区', '0571', '330113', '330100', '杭州市', '临平区,杭州市,浙江省', '330113,330100,330000', '119.715101', '30.231153', 'L', 3);
  18. SQL;
  19. $this->execute($sql);
  20. } catch (\Exception $e) {
  21. }
  22. }
  23. /**
  24. * {@inheritdoc}
  25. */
  26. public function safeDown()
  27. {
  28. echo "M241224145036AddStarRegion cannot be reverted.\n";
  29. return false;
  30. }
  31. }