Skip to content

Commit

Permalink
Merge branch '4.x' of https://github.com/craftcms/cms into 5.x
Browse files Browse the repository at this point in the history
# Conflicts:
#	CHANGELOG.md
  • Loading branch information
brandonkelly committed Apr 17, 2024
2 parents 313f2da + 4a3b276 commit 873314e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Unreleased

- Fixed a bug where the Database Backup utility was present when the `backupCommand` config setting was set to `false`.
- Fixed an error that occurred when running the `db/convert-charset` command, if any tables contained `char` or `varchar` foreign key columns. ([#14815](https://github.com/craftcms/cms/issues/14815))
- Fixed a bug where element selection modals were only showing the first 100 elements. ([#14790](https://github.com/craftcms/cms/issues/14790))
- Fixed a PHP error that could occur on the Dashboard if any Quick Post widgets hadn’t been saved since before Craft 1.2. ([#14794](https://github.com/craftcms/cms/issues/14794))
- Fixed a bug where double-clicking on an inline Matrix block tab would cause it to expand/collapse. ([#14791](https://github.com/craftcms/cms/issues/14791))
Expand Down
6 changes: 6 additions & 0 deletions src/console/controllers/DbController.php
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,10 @@ public function actionConvertCharset(?string $charset = null, ?string $collation
]);
}

// Disable FK checks
$queryBuilder = $db->getSchema()->getQueryBuilder();
$db->createCommand($queryBuilder->checkIntegrity(false))->execute();

foreach ($tableNames as $tableName) {
$tableName = $schema->getRawTableName($tableName);
$this->stdout('Converting ');
Expand All @@ -367,6 +371,8 @@ public function actionConvertCharset(?string $charset = null, ?string $collation
$this->stdout('done' . PHP_EOL, Console::FG_GREEN);
}

$db->createCommand()->checkIntegrity(true)->execute();

$this->stdout("Finished converting tables to $charset/$collation." . PHP_EOL, Console::FG_GREEN);
return ExitCode::OK;
}
Expand Down

0 comments on commit 873314e

Please sign in to comment.