From e0b4c2f6fa2cd385597f36aa83051f8c503466f9 Mon Sep 17 00:00:00 2001 From: MarJose123 <18107626+MarJose123@users.noreply.github.com> Date: Sun, 25 Aug 2024 14:18:49 +0800 Subject: [PATCH] [11.x] Fix UUID Drop on migration rollback --- database/2021_11_02_202021_update_wallets_uuid_table.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/database/2021_11_02_202021_update_wallets_uuid_table.php b/database/2021_11_02_202021_update_wallets_uuid_table.php index 55c752b24..61293b37d 100644 --- a/database/2021_11_02_202021_update_wallets_uuid_table.php +++ b/database/2021_11_02_202021_update_wallets_uuid_table.php @@ -40,7 +40,12 @@ public function up(): void public function down(): void { - Schema::dropColumns($this->table(), ['uuid']); + Schema::table($this->table(), function (Blueprint $table) { + if (Schema::hasColumn($this->table(), 'uuid')) { + $table->dropIndex('wallets_uuid_unique'); + $table->dropColumn('uuid'); + } + }); } private function table(): string