M231208061620InsertQimallRegion.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace app\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M231208061620InsertQimallRegion
  6. */
  7. class M231208061620InsertQimallRegion extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $sql = "INSERT INTO `qimall_region` (`id`, `name`, `parent_id`, `level`, `short_title`, `areacode`, `zipcode`, `initial`, `lng`, `lat`, `created_at`, `updated_at`) VALUES (10288, '高新技术开发区', 1728, 3, '', 0, 0, 'Y', '112.128537', '32.014797', NULL, NULL);";
  15. $this->execute($sql);
  16. $sql = "INSERT INTO `qimall_region` (`id`, `name`, `parent_id`, `level`, `short_title`, `areacode`, `zipcode`, `initial`, `lng`, `lat`, `created_at`, `updated_at`) VALUES (10289, '东津新区', 1728, 3, '', 0, 0, 'Y', '112.233161', '32.056027', NULL, NULL);";
  17. $this->execute($sql);
  18. }
  19. /**
  20. * {@inheritdoc}
  21. */
  22. public function safeDown()
  23. {
  24. echo "M231208061620InsertQimallRegion cannot be reverted.\n";
  25. return false;
  26. }
  27. /*
  28. // Use up()/down() to run migration code without a transaction.
  29. public function up()
  30. {
  31. }
  32. public function down()
  33. {
  34. echo "M231208061620InsertQimallRegion cannot be reverted.\n";
  35. return false;
  36. }
  37. */
  38. }