Bug 33671: (follow-up) Disable FK check for column change
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Wed, 12 Jul 2023 14:09:35 +0000 (14:09 +0000)
committerMatt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Wed, 19 Jul 2023 10:14:25 +0000 (10:14 +0000)
commit80fe98aff7ae91a1f24c2f7616343ebc2d264e53
treeda8307b9eff232ba027d991c475150088607d699
parentf26621c8c4ba4fbb292af99708d43593ea2e1e15
Bug 33671: (follow-up) Disable FK check for column change

See also BZ report. As suggested by Tomas.

NOTE: The dbrev is extended too for removing records with a failing guarantor_id
foreign key (theoretically not present obviously).

Test plan:
1) cp installer/data/mysql/db_revs/220600048.pl installer/data/mysql/atomicupdate/
2) Run updatedatabase.pl
3) Remove copied file

Bonus:
Manually remove FK constraint before running updatedatabase.
Insert a record with bad guarantor_id into relationships manually.
Run the update again.
You should not see the message that the constraint is removed.
Is the bad record count reported and record removed?

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Simplified. No longer removes the FK. Just disables during ALTER.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 0397251ece455801d5b3083feb84cf959cfcea83)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 4cdb3a57db739c8b5ad672444b02b333ef914762)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
installer/data/mysql/db_revs/220600048.pl