From 26756a7e0f6ca35e461004d2bef491fdab322931 Mon Sep 17 00:00:00 2001 From: ambrozt Date: Thu, 19 Sep 2024 22:02:05 +0200 Subject: [PATCH 1/2] Add support for dropping views in MSSQL server when running migrate/fresh --- framework/CHANGELOG.md | 1 + framework/console/controllers/MigrateController.php | 1 + 2 files changed, 2 insertions(+) diff --git a/framework/CHANGELOG.md b/framework/CHANGELOG.md index 55f9605adf..0109780b15 100644 --- a/framework/CHANGELOG.md +++ b/framework/CHANGELOG.md @@ -7,6 +7,7 @@ Yii Framework 2 Change Log - Bug #20232: Fix regression introduced in `GHSA-cjcc-p67m-7qxm` while attaching behavior defined by `__class` array key (erickskrauch) - Bug #20231: Fix regression introduced in #20167 in `yii\validators\FileValidator` (bizley) - Enh #20247: Support for variadic console controller action methods (brandonkelly) +- Enh #20256: Added missing MSSQL condition in `yii\console\controllers\MigrateController` isViewRelated function (ambrozt) 2.0.51 July 18, 2024 -------------------- diff --git a/framework/console/controllers/MigrateController.php b/framework/console/controllers/MigrateController.php index 315440f3bb..104c686574 100644 --- a/framework/console/controllers/MigrateController.php +++ b/framework/console/controllers/MigrateController.php @@ -333,6 +333,7 @@ class MigrateController extends BaseMigrateController $dropViewErrors = [ 'DROP VIEW to delete view', // SQLite 'SQLSTATE[42S02]', // MySQL + 'is a view. Use DROP VIEW', // Microsoft SQL Server ]; foreach ($dropViewErrors as $dropViewError) { From e69746b2b18bd9c7993efaeae71a362d593bc01c Mon Sep 17 00:00:00 2001 From: "Stefano D. Mtangoo" Date: Sat, 21 Sep 2024 12:05:44 +0300 Subject: [PATCH 2/2] correct CHANGELOG.md to reflect better changes in commit Co-authored-by: Alexander Makarov --- framework/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/CHANGELOG.md b/framework/CHANGELOG.md index 0109780b15..80a0547e49 100644 --- a/framework/CHANGELOG.md +++ b/framework/CHANGELOG.md @@ -7,7 +7,7 @@ Yii Framework 2 Change Log - Bug #20232: Fix regression introduced in `GHSA-cjcc-p67m-7qxm` while attaching behavior defined by `__class` array key (erickskrauch) - Bug #20231: Fix regression introduced in #20167 in `yii\validators\FileValidator` (bizley) - Enh #20247: Support for variadic console controller action methods (brandonkelly) -- Enh #20256: Added missing MSSQL condition in `yii\console\controllers\MigrateController` isViewRelated function (ambrozt) +- Bug #20256: Add support for dropping views in MSSQL server when running migrate/fresh (ambrozt) 2.0.51 July 18, 2024 --------------------