From 8b0c57415ad99f747007102ab4bf39b298be2b6b Mon Sep 17 00:00:00 2001 From: Amir Hossein Date: Mon, 25 Aug 2025 19:45:47 +0330 Subject: [PATCH] Revert "[12.x] Add drop patterns support to `TableGuesser` for drop migrations (#56608)" This reverts commit ab9e24982d5a51b7a07a157a39eaac598ec69230. --- .../Database/Console/Migrations/TableGuesser.php | 11 ----------- tests/Database/TableGuesserTest.php | 8 -------- 2 files changed, 19 deletions(-) diff --git a/src/Illuminate/Database/Console/Migrations/TableGuesser.php b/src/Illuminate/Database/Console/Migrations/TableGuesser.php index 2c90387b06fc..30bd53096e06 100644 --- a/src/Illuminate/Database/Console/Migrations/TableGuesser.php +++ b/src/Illuminate/Database/Console/Migrations/TableGuesser.php @@ -14,11 +14,6 @@ class TableGuesser '/.+_(to|from|in)_(\w+)$/', ]; - const DROP_PATTERNS = [ - '/^drop_(\w+)_table$/', - '/^drop_(\w+)$/', - ]; - /** * Attempt to guess the table name and "creation" status of the given migration. * @@ -38,11 +33,5 @@ public static function guess($migration) return [$matches[2], $create = false]; } } - - foreach (self::DROP_PATTERNS as $pattern) { - if (preg_match($pattern, $migration, $matches)) { - return [$matches[1], $create = false]; - } - } } } diff --git a/tests/Database/TableGuesserTest.php b/tests/Database/TableGuesserTest.php index d0a04c07d16f..f983995e4dd5 100644 --- a/tests/Database/TableGuesserTest.php +++ b/tests/Database/TableGuesserTest.php @@ -28,10 +28,6 @@ public function testMigrationIsProperlyParsed() [$table, $create] = TableGuesser::guess('drop_status_column_from_users_table'); $this->assertSame('users', $table); $this->assertFalse($create); - - [$table, $create] = TableGuesser::guess('drop_users_table'); - $this->assertSame('users', $table); - $this->assertFalse($create); } public function testMigrationIsProperlyParsedWithoutTableSuffix() @@ -55,9 +51,5 @@ public function testMigrationIsProperlyParsedWithoutTableSuffix() [$table, $create] = TableGuesser::guess('drop_status_column_from_users'); $this->assertSame('users', $table); $this->assertFalse($create); - - [$table, $create] = TableGuesser::guess('drop_users'); - $this->assertSame('users', $table); - $this->assertFalse($create); } }