| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <?php
- namespace app\migrations;
- use yii\db\Migration;
- /**
- * Class M230601023840ReplaceWuHanQingShanQuJieDaoData
- */
- class M230601023840ReplaceWuHanQingShanQuJieDaoData extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- // 替换街道名称
- $this->execute("REPLACE INTO `qimall_town` (`id`, `district_id`, `adcode`, `name`, `created_at`, `updated_at`) VALUES (22604, 1690, 150204, '红卫路街道', 1594556719, 1594556719);
- REPLACE INTO `qimall_town` (`id`, `district_id`, `adcode`, `name`, `created_at`, `updated_at`) VALUES (22605, 1690, 150204, '冶金街道', 1594556719, 1594556719);
- REPLACE INTO `qimall_town` (`id`, `district_id`, `adcode`, `name`, `created_at`, `updated_at`) VALUES (22606, 1690, 150204, '新沟桥街道', 1594556719, 1594556719);
- REPLACE INTO `qimall_town` (`id`, `district_id`, `adcode`, `name`, `created_at`, `updated_at`) VALUES (22607, 1690, 150204, '红钢城街道', 1594556719, 1594556719);
- REPLACE INTO `qimall_town` (`id`, `district_id`, `adcode`, `name`, `created_at`, `updated_at`) VALUES (22608, 1690, 150204, '工人村街道', 1594556719, 1594556719);
- REPLACE INTO `qimall_town` (`id`, `district_id`, `adcode`, `name`, `created_at`, `updated_at`) VALUES (22609, 1690, 150204, '青山镇街道', 1594556719, 1594556719);
- REPLACE INTO `qimall_town` (`id`, `district_id`, `adcode`, `name`, `created_at`, `updated_at`) VALUES (22610, 1690, 150204, '武东街道', 1594556719, 1594556719);
- REPLACE INTO `qimall_town` (`id`, `district_id`, `adcode`, `name`, `created_at`, `updated_at`) VALUES (22611, 1690, 150204, '白玉山街道', 1594556719, 1594556719);
- REPLACE INTO `qimall_town` (`id`, `district_id`, `adcode`, `name`, `created_at`, `updated_at`) VALUES (22612, 1690, 150204, '钢花村街道', 1594556719, 1594556719);
- REPLACE INTO `qimall_town` (`id`, `district_id`, `adcode`, `name`, `created_at`, `updated_at`) VALUES (22613, 1690, 150204, '钢都花园街道', 1594556719, 1594556719);
- REPLACE INTO `qimall_town` (`id`, `district_id`, `adcode`, `name`, `created_at`, `updated_at`) VALUES (22614, 1690, 150204, '乌素图街道', 1594556719, 1594556719);
- REPLACE INTO `qimall_town` (`id`, `district_id`, `adcode`, `name`, `created_at`, `updated_at`) VALUES (22615, 1690, 150204, '万青路街道', 1594556719, 1594556719);
- REPLACE INTO `qimall_town` (`id`, `district_id`, `adcode`, `name`, `created_at`, `updated_at`) VALUES (22616, 1690, 150204, '兴胜镇', 1594556719, 1594556719);
- REPLACE INTO `qimall_town` (`id`, `district_id`, `adcode`, `name`, `created_at`, `updated_at`) VALUES (22617, 1690, 150204, '万水泉镇', 1594556719, 1594556719);");
- // 删除多余数据行
- $this->execute("DELETE FROM qimall_town WHERE id IN(22614, 22615, 22616, 22617)");
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M230601023840ReplaceWuHanQingShanQuJieDaoData cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M230601023840ReplaceWuHanQingShanQuJieDaoData cannot be reverted.\n";
- return false;
- }
- */
- }
|