M230426075842RegionTownByShenZhen.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. namespace app\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M230426075842RegionTownByShenZhen
  6. */
  7. class M230426075842RegionTownByShenZhen extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. $this->execute("UPDATE `qimall_town` SET `district_id`=1968, `adcode`=230404, `name`='南头街道', `created_at`=1594556772, `updated_at`=1594556772 WHERE `id`=26298;
  15. UPDATE `qimall_town` SET `district_id`=1968, `adcode`=230404, `name`='南山街道', `created_at`=1594556772, `updated_at`=1594556772 WHERE `id`=26299;
  16. UPDATE `qimall_town` SET `district_id`=1968, `adcode`=230404, `name`='沙河街道', `created_at`=1594556772, `updated_at`=1594556772 WHERE `id`=26300;
  17. UPDATE `qimall_town` SET `district_id`=1968, `adcode`=230404, `name`='蛇口街道', `created_at`=1594556772, `updated_at`=1594556772 WHERE `id`=26301;
  18. UPDATE `qimall_town` SET `district_id`=1968, `adcode`=230404, `name`='招商街道', `created_at`=1594556772, `updated_at`=1594556772 WHERE `id`=26302;
  19. UPDATE `qimall_town` SET `district_id`=1968, `adcode`=230404, `name`='粤海街道', `created_at`=1594556772, `updated_at`=1594556772 WHERE `id`=26303;
  20. ");
  21. $this->execute("INSERT INTO `qimall_town` (`district_id`, `adcode`, `name`, `created_at`, `updated_at`) VALUES (1968, 230404, '桃源街道', 1594556772, 1594556772);");
  22. $this->execute("INSERT INTO `qimall_town` (`district_id`, `adcode`, `name`, `created_at`, `updated_at`) VALUES (1968, 230404, '西丽街道', 1594556772, 1594556772);");
  23. }
  24. /**
  25. * {@inheritdoc}
  26. */
  27. public function safeDown()
  28. {
  29. echo "M230426075842RegionTownByShenZhen cannot be reverted.\n";
  30. return false;
  31. }
  32. /*
  33. // Use up()/down() to run migration code without a transaction.
  34. public function up()
  35. {
  36. }
  37. public function down()
  38. {
  39. echo "M230426075842RegionTownByShenZhen cannot be reverted.\n";
  40. return false;
  41. }
  42. */
  43. }