I'm trying to import database tables from a file of table definitions. Near the top, there is a line setting foreign_key_checks
to 0, so that no errors would be thrown because of tables that reference other not-yet-created tables.
With an older version of MariaDB, this all worked fine.
However, with MariaDB 10.6 or later, when creating a table that has a check constraint referencing a table that does not yet exist, it throws an error even when this setting is set to 0.
Just a note here, that creating actual foreign keys on a new table that point to a non-existing table do not fail, only check constraints fail.
The SQL file was created with Adminer.
One solution could be to manually comment out the check constraints in the "create table" statements, and add them at the bottom of the file in "alter table" statements, but I would prefer to not do this, as it requires manual intervention.
Any ideas for workarounds or solutions?