mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-02-05 00:29:40 +03:00
Error importing database from MariaDB 10.3.34 to 10.5.15 - Foreign key constraint #1312
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jbuggie on GitHub (Jul 6, 2022).
I have a simple script to back up the production db to a standby db via mysql-dump and import. Recently, one of the back up servers has been upgraded to a new MariaDB version 10.5.15 and it gives the following error trying to import the database:
ERROR 1005 (HY000) at line 75: Can't create table
bitwarden.ciphers(errno: 150 "Foreign key constraint is incorrectly formed")Line #75 of the dump :
CREATE TABLE
ciphers(uuidchar(36) NOT NULL,created_atdatetime NOT NULL,updated_atdatetime NOT NULL,user_uuidchar(36) DEFAULT NULL,organization_uuidchar(36) DEFAULT NULL,atypeint(11) NOT NULL,nametext NOT NULL,notestext DEFAULT NULL,fieldstext DEFAULT NULL,datatext NOT NULL,password_historytext DEFAULT NULL,deleted_atdatetime DEFAULT NULL,repromptint(11) DEFAULT NULL,PRIMARY KEY (
uuid)) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
Further log info:
LATEST FOREIGN KEY ERROR
2022-07-06 15:49:12 0x7f06682ab700 Error in foreign key constraint of table bitwarden/ciphers_collections:
there is no index in referenced table which would contain
the columns as the first columns, or the data types in the
referenced table do not match the ones in table. Constraint:
,
CONSTRAINT
ciphers_collections_ibfk_1FOREIGN KEY (cipher_uuid) REFERENCESciphers(uuid)The index in the foreign key in table is PRIMARY
Please refer to https://mariadb.com/kb/en/library/foreign-keys/ for correct foreign key definition.
Any suggestion for resolving this? Thanks.