| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <?php
- namespace app\migrations;
- use yii\db\Migration;
- /**
- * Class M230210095051UpdateQimallTown
- */
- class M230210095051UpdateQimallTown extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- try {
- $sql = "update qimall_town set name ='丰财街道' where id = '11286' and district_id = '833';
- update qimall_town set name ='环城街道' where id = '11287' and district_id = '833';
- update qimall_town set name ='琵琶街道' where id = '11288' and district_id = '833';
- update qimall_town set name ='铜沛街道' where id = '11289' and district_id = '833';
- update qimall_town set name ='牌楼街道' where id = '11290' and district_id = '833';
- update qimall_town set name ='黄楼街道' where id = '11291' and district_id = '833';
- update qimall_town set name ='九里街道' where id = '11292' and district_id = '833';
- update qimall_town set name ='拾屯街道' where id = '11293' and district_id = '833';
- DELETE FROM qimall_town where id in(11294,11295,11296,11297,11298) and district_id = '833';";
- $this->execute($sql);
- } catch (\Exception $e) {
- }
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M230210095051UpdateQimallTown cannot be reverted.\n";
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M230210095051UpdateQimallTown cannot be reverted.\n";
- return false;
- }
- */
- }
|