Open danystad opened 2 days ago
Run the following SQL query:
SHOW CREATE TABLE craft_categorygroups
What is the Create Table
response?
Here is the Create Table
response
CREATE TABLE `craft_categorygroups` (
`id` int NOT NULL AUTO_INCREMENT,
`structureId` int NOT NULL,
`fieldLayoutId` int DEFAULT NULL,
`name` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL,
`handle` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL,
`defaultPlacement` enum('beginning','end') COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT 'end',
`dateCreated` datetime NOT NULL,
`dateUpdated` datetime NOT NULL,
`dateDeleted` datetime DEFAULT NULL,
`uid` char(36) COLLATE utf8mb3_unicode_ci NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `craft_categorygroups_structureId_fk` (`structureId`),
KEY `craft_categorygroups_fieldLayoutId_fk` (`fieldLayoutId`),
KEY `craft_idx_zppslhqcpokkmeisgznyvoeeqiplfgcxbocl` (`dateDeleted`),
KEY `craft_idx_sninfyatqphofeiodkvdfzykrxkoapqshlvu` (`name`),
KEY `craft_idx_lapqmhdzaxuvmhestsczuvwsfktnyoqupoeg` (`handle`),
CONSTRAINT `craft_categorygroups_fieldLayoutId_fk` FOREIGN KEY (`fieldLayoutId`) REFERENCES `craft_fieldlayouts` (`id`) ON DELETE SET NULL,
CONSTRAINT `craft_categorygroups_structureId_fk` FOREIGN KEY (`structureId`) REFERENCES `craft_structures` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci ROW_FORMAT=COMPACT
What happened?
Description
After upgrading a Craft 4 website to Craft 5 and running the
php craft db/convert-charset
command as described in the Upgrading from Craft 4, I'm running into an Exception 'yii\db\Exception' with message 'SQLSTATE[42000] error.Steps to reproduce
php craft db/convert-charset
Expected behavior
All database tables should be converted to utf8mb4 character set and utf8mb4_0900_ai_ci collation.
Actual behavior
The following error:
Craft CMS version
Craft Pro 5.5.2
PHP version
8.3.12
Operating system and version
Linux 6.11.9-orbstack-00279-g4cf512143f2e (DDEV)
Database type and version
MySQL 8.0.36
Image driver and version
Imagick 3.7.0 (ImageMagick 6.9.11-60)
Installed plugins and versions