From 98c70d126db1853c9d4e2040404ce5a21c45568a Mon Sep 17 00:00:00 2001 From: lion <120344285@qq.com> Date: Mon, 20 Apr 2026 18:04:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=BA=E9=A6=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...4_120000_flip_venue_sort_1_through_101.php | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 database/migrations/2026_04_24_120000_flip_venue_sort_1_through_101.php diff --git a/database/migrations/2026_04_24_120000_flip_venue_sort_1_through_101.php b/database/migrations/2026_04_24_120000_flip_venue_sort_1_through_101.php new file mode 100644 index 0000000..bd7cc26 --- /dev/null +++ b/database/migrations/2026_04_24_120000_flip_venue_sort_1_through_101.php @@ -0,0 +1,44 @@ += 1 AND `sort` <= 101' + ); + + return; + } + + if ($driver === 'pgsql') { + DB::update( + 'UPDATE venues SET sort = 102 - sort WHERE sort >= 1 AND sort <= 101' + ); + + return; + } + + if ($driver === 'sqlite') { + DB::update( + 'UPDATE venues SET sort = 102 - sort WHERE sort >= 1 AND sort <= 101' + ); + } + } + + public function down(): void + { + // 再执行一次相同变换即可还原(对称) + $this->up(); + } +};