]> git.koha-community.org Git - koha.git/commit
Bug 17234: Need to separate KEY and FOREIGN KEY checks
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 12 Jan 2017 09:44:46 +0000 (10:44 +0100)
committerKatrin Fischer <katrin.fischer.83@web.de>
Sun, 15 Jan 2017 16:06:47 +0000 (17:06 +0100)
commitba45608b0d823e4bac4e6794392d53f4eda4b9c2
tree2b5685768a3fb8bdef1d5eb1fcda94b1e53a34f4
parentcd6782d5b4be87f724b5d2d36ff1dedd4cfab503
Bug 17234: Need to separate KEY and FOREIGN KEY checks

In the previous patch we use the constraint_exists subroutine to verify
if an index or a foreign key exists.
But the `SHOW INDEX` query does not return foreign keys (as its name
suggests!).
We need another subroutine foreign_key_exists to check the FK existence.

I have found that because t/db_dependent/TestBuilder.t fails on
oai_sets_biblios, because oai_sets_biblios_ibfk_1 has not been removed.

Test plan:
0/ Do not apply this patch
1/ Use a 3.20 DB
2/ update the DB
3/ SHOW CREATE TABLE oai_sets_biblios
will display oai_sets_biblios_ibfk_1

Apply the patch and repeat 1, 2, 3
=> Will not display oai_sets_biblios_ibfk_1
It has been removed as expected.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 05fdd855c8da85d3be27d42721f6a544b0145e57)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
C4/Installer.pm
installer/data/mysql/updatedatabase.pl
t/db_dependent/Installer.t