Bug 18058: Allow borrower_message_preferences to be truncated
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 14 Feb 2017 14:39:48 +0000 (14:39 +0000)
committerJulian Maurice <julian.maurice@biblibre.com>
Fri, 21 Apr 2017 09:26:56 +0000 (11:26 +0200)
commit2907d4bf907ec1d3f6a618f29bc5859837b559e4
treeade2de46cc8db5ec342bd9ed769470e3fe17fdff
parent2e9be0441c63603d1d48e5b4fb9272bef0dba071
Bug 18058: Allow borrower_message_preferences to be truncated

borrower_message_preferences cannot be truncated because of the foreign.
DBMS fails with
  "Cannot truncate a table referenced in a foreign key constraint"

To avoid that we should remove the FK check and truncate the other table
as well.

I am wondering if we really need a truncate here
  DELETE FROM borrower_message_preferences;
should do the job, but leave it as it because of the param name.

Test plan
  perl misc/maintenance/borrowers-force-messaging-defaults --doit --truncate
Should no longer raise the error message

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit dd88c8f710e4915dac6437355c356f0632b776fb)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
(cherry picked from commit e2f860386dd811b2be3b2988b690c2d28d748336)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
misc/maintenance/borrowers-force-messaging-defaults