Koha-clms/installer/data/mysql
Marcel de Rooy a6c8050c28 Bug 16170: Pseudo foreign key in Items
While many of us would like to get rid of biblioitems one day, the current
scheme includes a biblioitemnumber and a biblionumber in Items.
(Which is not so great..)

But also note that biblionumber is NOT defined as a foreign key in Items,
although a belongs_to relation has been added to the DBIx scheme!
This inconsistency should be resolved. The "remove biblioitem table"
operation is a large one, but in the meantime we better make biblionumber
a regular FK not a 'pseudo' one.

Note: If in an (very) exceptional case biblionumbers are found in items,
that do not exist in biblio, this patch prints a warning at upgrade
time and does not add the constraint.

@RM: Please update the DBIx scheme accordingly.

Test plan:
[1] Run the upgrade. Check if the FK constraint has been added.
[2] Remove the FK constraint. Change the biblionumber of one item to an
    unexisting record. Run the upgrade again. Notice the warning.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested both cases: constraint added as well as warning printed.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 33694a8faa)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
2016-05-16 09:51:58 +02:00
..
atomicupdate Bug 16170: Pseudo foreign key in Items 2016-05-16 09:51:58 +02:00
de-DE Bug 15181: Rename marc21 fast add framework sql file 2015-11-16 12:34:31 -03:00
en Bug 15411: Changing 'Non fiction' to 'Non-fiction' 2016-02-15 08:57:59 +01:00
es-ES Bug 15411: Changing 'Non fiction' to 'Non-fiction' 2016-02-15 08:57:59 +01:00
fr-FR Bug 15177: TO_PROCESS notice for fr-FR 2015-11-12 10:11:48 -03:00
it-IT Bug 15411: More changes 2016-02-15 08:58:08 +01:00
mandatory Bug 14285: Bengali locale needs to be re-defined 2015-06-01 15:22:27 -03:00
nb-NO Bug 15181: Rename marc21 fast add framework sql file 2015-11-16 12:34:31 -03:00
pl-PL Bug 15411: More changes 2016-02-15 08:58:08 +01:00
ru-RU Bug 15177: Add missing coma in ru-RU 2015-11-12 10:11:55 -03:00
uk-UA Bug 15177: Sample notice TO_PROCESS confuses budget and fund 2015-11-12 10:11:46 -03:00
audio_alerts.sql Bug 11431: (QA followup) Make audio alerts sql top level 2015-11-04 12:33:53 -03:00
backfill_statistics.pl Bug 5370: Fix all the references to koha.org 2010-11-08 09:41:49 +13:00
kohastructure.sql Bug 16170: Pseudo foreign key in Items 2016-05-16 09:51:58 +02:00
labels_upgrade.pl Bug 9978: Replace license header with the correct license (GPLv3+) 2015-04-20 09:59:38 -03:00
patroncards_upgrade.pl Bug 9978: Replace license header with the correct license (GPLv3+) 2015-04-20 09:59:38 -03:00
sysprefs.sql Bug 16041: Turn off StaffAuthorisedValueImages by default 2016-05-16 09:30:32 +02:00
update22to30.pl Bug 11398: A typo occurred with occured 2014-01-02 15:12:48 +00:00
updatedatabase.pl Bug 16041: Update DB rev (3.22.06.002) 2016-05-16 09:33:42 +02:00
userflags.sql Bug 13632: Populate user_flags and permissions tables in the web installer 2015-10-19 09:38:04 -03:00
userpermissions.sql Bug 11569: Correcting typos in userpermissions.sql 2016-02-01 17:52:26 +01:00