M230601023840ReplaceWuHanQingShanQuJieDaoData.php 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. namespace app\migrations;
  3. use yii\db\Migration;
  4. /**
  5. * Class M230601023840ReplaceWuHanQingShanQuJieDaoData
  6. */
  7. class M230601023840ReplaceWuHanQingShanQuJieDaoData extends Migration
  8. {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function safeUp()
  13. {
  14. // 替换街道名称
  15. $this->execute("REPLACE INTO `qimall_town` (`id`, `district_id`, `adcode`, `name`, `created_at`, `updated_at`) VALUES (22604, 1690, 150204, '红卫路街道', 1594556719, 1594556719);
  16. REPLACE INTO `qimall_town` (`id`, `district_id`, `adcode`, `name`, `created_at`, `updated_at`) VALUES (22605, 1690, 150204, '冶金街道', 1594556719, 1594556719);
  17. REPLACE INTO `qimall_town` (`id`, `district_id`, `adcode`, `name`, `created_at`, `updated_at`) VALUES (22606, 1690, 150204, '新沟桥街道', 1594556719, 1594556719);
  18. REPLACE INTO `qimall_town` (`id`, `district_id`, `adcode`, `name`, `created_at`, `updated_at`) VALUES (22607, 1690, 150204, '红钢城街道', 1594556719, 1594556719);
  19. REPLACE INTO `qimall_town` (`id`, `district_id`, `adcode`, `name`, `created_at`, `updated_at`) VALUES (22608, 1690, 150204, '工人村街道', 1594556719, 1594556719);
  20. REPLACE INTO `qimall_town` (`id`, `district_id`, `adcode`, `name`, `created_at`, `updated_at`) VALUES (22609, 1690, 150204, '青山镇街道', 1594556719, 1594556719);
  21. REPLACE INTO `qimall_town` (`id`, `district_id`, `adcode`, `name`, `created_at`, `updated_at`) VALUES (22610, 1690, 150204, '武东街道', 1594556719, 1594556719);
  22. REPLACE INTO `qimall_town` (`id`, `district_id`, `adcode`, `name`, `created_at`, `updated_at`) VALUES (22611, 1690, 150204, '白玉山街道', 1594556719, 1594556719);
  23. REPLACE INTO `qimall_town` (`id`, `district_id`, `adcode`, `name`, `created_at`, `updated_at`) VALUES (22612, 1690, 150204, '钢花村街道', 1594556719, 1594556719);
  24. REPLACE INTO `qimall_town` (`id`, `district_id`, `adcode`, `name`, `created_at`, `updated_at`) VALUES (22613, 1690, 150204, '钢都花园街道', 1594556719, 1594556719);
  25. REPLACE INTO `qimall_town` (`id`, `district_id`, `adcode`, `name`, `created_at`, `updated_at`) VALUES (22614, 1690, 150204, '乌素图街道', 1594556719, 1594556719);
  26. REPLACE INTO `qimall_town` (`id`, `district_id`, `adcode`, `name`, `created_at`, `updated_at`) VALUES (22615, 1690, 150204, '万青路街道', 1594556719, 1594556719);
  27. REPLACE INTO `qimall_town` (`id`, `district_id`, `adcode`, `name`, `created_at`, `updated_at`) VALUES (22616, 1690, 150204, '兴胜镇', 1594556719, 1594556719);
  28. REPLACE INTO `qimall_town` (`id`, `district_id`, `adcode`, `name`, `created_at`, `updated_at`) VALUES (22617, 1690, 150204, '万水泉镇', 1594556719, 1594556719);");
  29. // 删除多余数据行
  30. $this->execute("DELETE FROM qimall_town WHERE id IN(22614, 22615, 22616, 22617)");
  31. }
  32. /**
  33. * {@inheritdoc}
  34. */
  35. public function safeDown()
  36. {
  37. echo "M230601023840ReplaceWuHanQingShanQuJieDaoData cannot be reverted.\n";
  38. return false;
  39. }
  40. /*
  41. // Use up()/down() to run migration code without a transaction.
  42. public function up()
  43. {
  44. }
  45. public function down()
  46. {
  47. echo "M230601023840ReplaceWuHanQingShanQuJieDaoData cannot be reverted.\n";
  48. return false;
  49. }
  50. */
  51. }