最新的 4.1.2 包的新鲜拉动以及 config.yml 设置为与 utf8mb4 一起使用时 -- @Michael Bessolov
doctrine:
dbal:
charset: utf8mb4
default_table_options:
charset: utf8mb4
collate: utf8mb4_unicode_ci
在数据库设置/进程迁移之前,我收到以下错误。但是,在没有上述 config.yml 修改的情况下安装时,安装成功。我已经完美地使用了 utf8mb4 和 4.1.0 和 4.1.1 以及整个 3.1 分支与当前设置。似乎只是在最近的修订版中引入。
最初的错误消息是在 MariaDB 10.4.12 上,第二个是在 Andrey 提到错误消息格式后针对 MySQL 5.7.29 进行测试之后。
MariaDB 10.4.12-
> Oro\Bundle\DataAuditBundle\Migrations\Schema\OroDataAuditBundleInstaller
ERROR: An exception occurred while executing 'CREATE TABLE oro_audit (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, organization_id INT DEFAULT NULL, impersonation_id INT DEFAULT NULL, action VARCHAR(8) DEFAULT NULL, logged_at DATETIME DEFAULT NULL COMMENT '(DC2Type:datetime)', object_id VARCHAR(255) DEFAULT NULL, object_class VARCHAR(255) NOT NULL, object_name VARCHAR(255) DEFAULT NULL, version INT DEFAULT NULL, type VARCHAR(255) NOT NULL, transaction_id VARCHAR(255) NOT NULL, owner_description VARCHAR(255) DEFAULT NULL, additional_fields LONGTEXT DEFAULT NULL COMMENT '(DC2Type:array)', INDEX IDX_5FBA427CA76ED395 (user_id), INDEX idx_oro_audit_type (type), UNIQUE INDEX idx_oro_audit_version (object_id, object_class, version, type), UNIQUE INDEX idx_oro_audit_transaction (object_id, object_class, transaction_id, type), INDEX idx_oro_audit_logged_at (logged_at), INDEX idx_oro_audit_object_class (object_class), INDEX idx_oro_audit_obj_by_type (object_id, object_class, type), INDEX idx_oro_audit_owner_descr (owner_description), INDEX idx_oro_audit_organization_id (organization_id), INDEX IDX_5FBA427C26F87DB8 (impersonation_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB':
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 3072 bytes
@Andrey Yatsenko
MySQL 5.7.29 - 编辑:缺少英文翻译,现在显示相同的错误
> Oro\Bundle\DataAuditBundle\Migrations\Schema\OroDataAuditBundleInstaller
ERROR: An exception occurred while executing 'CREATE TABLE oro_audit (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, organization_id INT DEFAULT NULL, impersonation_id INT DEFAULT NULL, action VARCHAR(8) DEFAULT NULL, logged_at DATETIME DEFAULT NULL COMMENT '(DC2Type:datetime)', object_id VARCHAR(255) DEFAULT NULL, object_class VARCHAR(255) NOT NULL, object_name VARCHAR(255) DEFAULT NULL, version INT DEFAULT NULL, type VARCHAR(255) NOT NULL, transaction_id VARCHAR(255) NOT NULL, owner_description VARCHAR(255) DEFAULT NULL, additional_fields LONGTEXT DEFAULT NULL COMMENT '(DC2Type:array)', INDEX IDX_5FBA427CA76ED395 (user_id), INDEX idx_oro_audit_type (type), UNIQUE INDEX idx_oro_audit_version (object_id, object_class, version, type), UNIQUE INDEX idx_oro_audit_transaction (object_id, object_class, transaction_id, type), INDEX idx_oro_audit_logged_at (logged_at), INDEX idx_oro_audit_object_class (object_class), INDEX idx_oro_audit_obj_by_type (object_id, object_class, type), INDEX idx_oro_audit_owner_descr (owner_description), INDEX idx_oro_audit_organization_id (organization_id), INDEX IDX_5FBA427C26F87DB8 (impersonation_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB':
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 3072 bytes