M230515151736InsertQimallRegion.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. namespace app\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M230515151736InsertQimallRegion
  6. */
  7. class M230515151736InsertQimallRegion extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. try {
  15. $sql="INSERT INTO `qimall_region`(`id`,`name`, `parent_id`, `level`, `short_title`, `areacode`, `zipcode`, `initial`, `lng`, `lat`, `created_at`, `updated_at`) VALUES (10065, '大鹏新区', 1965, 3, '', 0, 0, 'D', '114.422632', '22.645334', NULL, NULL);";
  16. $this->execute($sql);
  17. }catch (\Exception $e){
  18. }
  19. }
  20. /**
  21. * {@inheritdoc}
  22. */
  23. public function safeDown()
  24. {
  25. echo "M230515151736InsertQimallRegion cannot be reverted.\n";
  26. return false;
  27. }
  28. /*
  29. // Use up()/down() to run migration code without a transaction.
  30. public function up()
  31. {
  32. }
  33. public function down()
  34. {
  35. echo "M230515151736InsertQimallRegion cannot be reverted.\n";
  36. return false;
  37. }
  38. */
  39. }