Koha-clms/installer/data/mysql
Lucas Gass 4066d2a4fc
Bug 40725: Add TableExists check to db_revs/231200053.pl
This patch makes the DB revision idempotent.

To test:
1. Fix the Koha version right before the broken upgrade:
   $ ktd --shell
  k$ koha-mysql kohadev
   > UPDATE systempreferences SET value="23.1200052" WHERE
variable="version"; \q
2. Restart everything (memcached should be enough)
  k$ restart_all
3. Run:
  k$ updatedatabase
=> FAIL: You get:

```shell
Upgrade to 23.12.00.053  [19:34:35]: Bug 36755 - Increase length of 'code' column in borrower_attribute_types
	ERROR: C4::Installer::foreign_key_exists(): DBI Exception: DBD::mysql::db selectrow_array failed: Table 'koha_kohadev.pseudonymized_borrower_attributes' doesn't exist at /kohadevbox/koha/installer/data/mysql/db_revs/231200053.pl line 11
```

4. Apply this patch
5. Repeat 3
=> SUCCESS: Update runs smoothly!
6. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-08-28 13:54:34 -06:00
..
atomicupdate Bug 37901: DBRev 25.06.00.011 2025-08-20 13:43:26 -06:00
db_revs Bug 40725: Add TableExists check to db_revs/231200053.pl 2025-08-28 13:54:34 -06:00
en Bug 36114: Adjust TRANSFERSLIP to use Template Toolkit 2025-08-14 16:05:48 -06:00
localization Bug 27490: (follow-up) Fix custom installer files 2024-09-13 13:54:26 +02:00
mandatory Bug 35467: Rename NewsLog system preference to AdditionalContent 2025-08-13 13:39:29 -06:00
backfill_statistics.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
fix_unclosed_nonaccruing_fines_bug17135.pl Bug 39325: Automatic fix 2025-04-28 18:51:22 +02:00
kohastructure.sql Bug 37901: Add 'illrequest_id' column to statistics 2025-08-20 13:43:21 -06:00
labels_upgrade.pl Bug 39325: Automatic fix 2025-04-28 18:51:22 +02:00
needs_update.pl Bug 34088: Move the 'needs update' test to a separate script 2024-09-17 10:48:39 +02:00
patroncards_upgrade.pl Bug 39325: Automatic fix 2025-04-28 18:51:22 +02:00
update22to30.pl Bug 38664: Tidy the whole codebase 2025-02-11 14:58:24 +01:00
updatedatabase.pl Bug 38664: Fix updatedatabase.pl 2025-02-12 06:39:59 +01:00