| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- <?php
- namespace app\migrations;
- use yii\db\Migration;
- /**
- * Class M240703030607UpdateExpressSort
- */
- class M240703030607UpdateExpressSort extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- $sql = <<<SQL
- UPDATE `qimall_express` SET `sort` = 1 WHERE `id` = 1;
- UPDATE `qimall_express` SET `sort` = 2 WHERE `id` = 2;
- UPDATE `qimall_express` SET `sort` = 3 WHERE `id` = 3;
- UPDATE `qimall_express` SET `sort` = 4 WHERE `id` = 5;
- UPDATE `qimall_express` SET `sort` = 5 WHERE `id` = 6;
- UPDATE `qimall_express` SET `sort` = 6 WHERE `id` = 7;
- UPDATE `qimall_express` SET `sort` = 7 WHERE `id` = 4;
- UPDATE `qimall_express` SET `sort` = 8 WHERE `id` = 103;
- UPDATE `qimall_express` SET `sort` = 9 WHERE `id` = 18;
- SQL;
- $this->execute($sql);
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- return false;
- }
- /*
- // Use up()/down() to run migration code without a transaction.
- public function up()
- {
- }
- public function down()
- {
- echo "M240703030607UpdateExpressSort cannot be reverted.\n";
- return false;
- }
- */
- }
|