Koha-clms/installer/data/mysql
Katrin Fischer 0ce62b29bf Bug 18050: Add FK constraint on aqbudgets.budget_period_id
This adds a FK constraint on aqbudgets.budget_period_id so that
a fund cannot be added with an invalid aqbudget.budget_period_id.

We should not have funds that belong to no budget. In case we have, the
update will be skipped and a note displayed.

Part1:
- Before applying the patch
- Make sure you have a budget with some funds linked to it
- You will have to change one of the funds to link to an invalid
  budget with SQL:
  UPDATE aqbudgets SET budget_period_id = 999 WHERE budget_id = max(budget_id);
- Apply patch
- Run updatedatabase - verify that you see the hint about 1 existing fund with invalid budget.
- Repair your fund with SQL
  UPDATE aqbudgets SET budget_period_id = ... WHERE budget_id = max(budget_id);
  (... needs to be your existing budget_period_id)
- Run updatedatabase again - verify it runs successfully now.
- If you try to change the budget_period_id to a non-existing now with SQL, you will
  get a database error. The new FK doesn't permit it.
Part 2:
- Start fresh with the web installer, verify there are no errors on
  creating the database tables

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-10-26 00:14:42 +01:00
..
atomicupdate Bug 18050: Add FK constraint on aqbudgets.budget_period_id 2020-10-26 00:14:42 +01:00
en Bug 26018: Fix frameworks errors with subfields in wrong tab 2020-10-14 11:47:57 +02:00
fr-CA Bug 21066: Rename publicationdate with published_on 2020-09-02 15:35:08 +02:00
fr-FR Bug 26007: (QA follow-up) Replace wrong link values from sql installer files 2020-09-09 15:39:51 +02:00
it-IT Bug 26613: Fix it-IT unimarc_framework.sql installer file 2020-10-26 00:14:41 +01:00
localization Bug 20168: Remove li tags from OPACSearchForTitleIn for new installs 2020-09-09 14:33:45 +02:00
mandatory Bug 25596: Identify overpayment refunds for translation 2020-10-26 00:14:41 +01:00
nb-NO Bug 26007: (QA follow-up) Replace wrong link values from sql installer files 2020-09-09 15:39:51 +02:00
pl-PL Bug 26268: Correct mapping for internal note to items.itemnotes_nonpublic 2020-10-01 10:32:15 +02:00
ru-RU Bug 26268: Correct mapping for internal note to items.itemnotes_nonpublic 2020-10-01 10:32:15 +02:00
uk-UA Bug 26268: Correct mapping for internal note to items.itemnotes_nonpublic 2020-10-01 10:32:15 +02:00
backfill_statistics.pl Bug 13795: Remove occurences of unused columns in code 2019-04-18 10:05:51 +00:00
fix_unclosed_nonaccruing_fines_bug17135.pl Bug 24840: Replace DateTime->now with dt_from_string 2020-04-08 11:54:23 +01:00
kohastructure.sql Bug 18050: Add FK constraint on aqbudgets.budget_period_id 2020-10-26 00:14:42 +01:00
labels_upgrade.pl Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
patroncards_upgrade.pl Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
update22to30.pl Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
updatedatabase.pl Bug 25596: DBRev 20.06.00.054 2020-10-26 00:14:41 +01:00