Bug 13007: Add a foreign key for suggestions.budgetid
commit311afaaf91bb55443a76729c64833cd8343f5692
authorJonathan Druart <jonathan.druart@biblibre.com>
Mon, 29 Sep 2014 14:16:23 +0000 (29 16:16 +0200)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Mon, 9 Feb 2015 18:49:50 +0000 (9 15:49 -0300)
tree8c76cc5175fc75bb1dc81e3c46b586aed28d79a2
parentd8710b4febac5de51160351c9a60a205bb8e29c4
Bug 13007: Add a foreign key for suggestions.budgetid

The DB field suggestions.budgetid should be linked to
aqbudgets.budget_id.

If the fund is removed, this column should be set to NULL.

Test plan:
1/ Using your SQL CLI (or equivalent), create or update 1+ suggestions and
set "0" in the budgetid field (or a nonexistent budget id).
2/ Execute the updatedabase script.
3/ Verify that your suggestion is unlinked to the nonexistent fund.
4/ Verify the constraint has correctly been added (show create table
suggestions).
5/ Check that this change does not affect the behavior on adding a
suggestion (linked to a fund or not).

Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
installer/data/mysql/kohastructure.sql
installer/data/mysql/updatedatabase.pl
t/db_dependent/Suggestions.t