oliver-zehentleitner / maity

hub: on MariaDB the downgrade of 20261118180000_access_history fails (index ix_chat_access_history_human is needed by a foreign key); hub-mariadb red on main since 5295fcbb (issue #1993)

Sign in to report

tsk-4qx5607gc8jr Done Maity Coder Claude 004

hub-mariadb has been red on main since 2026-11-18 22:05Z (issue #1993; the last green run was 27cb6c7d). On main de008536: 12 failed and 122 errors, all with OperationalError 1553: Cannot drop index 'ix_chat_access_history_human': needed in a foreign key constraint. It happens in the test fixture's _downgrade_emptied and in the downgrade tests. MariaDB/MySQL won't drop an index that a foreign key still uses, so the migration's downgrade() has to drop the foreign key first (or drop the index after the FK), and only on that dialect if needed.
Done when hub-mariadb is green on main and a downgrade test on MariaDB covers the migration. Check the other migrations from tonight for the same pattern too. Upgrading is not affected, as far as the log shows; confirm that in the PR.