wooden-country-13195
09/27/2024, 12:46 PMerror executing migrations/sql/20210817181232000006_unique_credentials.mysql.up.sql, sql: ALTER TABLE `identity_credential_identifiers` MODIFY `identity_credential_type_id` char(36) NOT NULL;: Error 1832 (HY000): Cannot change column 'identity_credential_type_id': used in a foreign key constraint 'identity_credential_identifiers_type_id_fk_idx'
This is with mysql running in docker: <http://docker.io/bitnami/mysql:8.4.2-debian-12-r4|docker.io/bitnami/mysql:8.4.2-debian-12-r4>
and a fresh empty database. I found an issue about this, and the recommended solution is to set mysql's sql_mode
to TRADITIONAL
. I tried that by setting the env var MYSQL_EXTRA_FLAGS
to --sql-mode=TRADITIONAL
, but the kratos error remains.
Any suggestions? I feel like I must be missing something because I expect many kratos users use mysql.magnificent-energy-493
magnificent-energy-493
wooden-country-13195
10/01/2024, 8:10 AMwooden-country-13195
10/01/2024, 8:19 AMSET FOREIGN_KEY_CHECKS = 0;
), but that would be very cumbersome in our automatically provisioned fleet of instances, we'd probably have to build our own kratos docker images and keep those updated.wooden-country-13195
10/01/2024, 8:20 AMmagnificent-energy-493
wooden-country-13195
10/01/2024, 8:37 AMwooden-country-13195
10/01/2024, 9:57 AMsql_mode=''
in our template for the dsn setting for kratos, removing that fixed it. That setting was no problem with mariadb -- in fact it was presumably necessary at some point in time -- but it is with mysql.