diff --git a/CHANGELOG.md b/CHANGELOG.md index 276e6ac29a..21e7c8f5b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ - Fixed a bug where the delete button would be shown for users that do not have permission to delete on the Product edit page. ([#3285](https://github.com/craftcms/commerce/issues/3285)) - Fixed a bug where deleted shipping categories were still available for selection. ([#3272](https://github.com/craftcms/commerce/issues/3272)) - Fixed an error that could occur when rendering a PDF. ([#2633](https://github.com/craftcms/commerce/issues/2633)) +- Fixed a bug where duplicate inactive users could be created when using the `commerce/upgrade` command. ([#3286](https://github.com/craftcms/commerce/issues/3286)) ## 4.3.0 - 2023-09-13 diff --git a/src/console/controllers/UpgradeController.php b/src/console/controllers/UpgradeController.php index 8b6b50dff3..ff274714cc 100644 --- a/src/console/controllers/UpgradeController.php +++ b/src/console/controllers/UpgradeController.php @@ -1179,6 +1179,7 @@ public function _migrateCustomers(): void ->leftJoin(['u' => $usersTable], 'o.email = u.email') ->where(['u.email' => null]) ->andWhere(['not', ['o.email' => null]]) + ->groupBy(['[[o.email]]']) ->column(); $this->stdoutlast(' Done. Found ' . count($guestEmails) . ' guest emails.', Console::FG_GREEN);