Koha/installer/data/mysql/db_revs
Kyle M Hall 0b1a1261ff Bug 33847: Database update replaces undefined rules with defaults rather than the value that would be used
Bug 29012 introduces a database update that sets the default values for rules that are required but undefined. This functionally changes the results of the circulation rules.

Instead, this update should find value that is being used for that rule combo and use that as the rule value, only using the default in the case that the derived rule doesn't exist or has a null value.

Test Plan:
1) Check out Koha 22.05.05
2) Create a default all/all/all rule, 3 other rules. Ensure they all have Loan period set to 7, with one of the non-default rules having a Loan period of 14.
3) Delete all but one of the non-default rules with the following query:
   Delete from circulation_rules where rule_name  = 'issuelength' and ( rule_value != 14 and not ( branchcode is null and categorycode is null and itemtype is null ) ) limit 2;
4) Check out 254f721320
5) Run updatedatabase.pl and restart
6) Note the rules were recreated with the value 0
7) Repeat steps 1-4
8) Apply this patch
9) If you're using the same database, set the version to 22.0600023 and restart
10) Run updatedatabase.pl
11) Note the rules were recreated, but the value is the derived value from the all/all/all rule!

Signed-off-by: Kevin Carnes <kevin.carnes@ub.lu.se>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>

Bug 33847: Rewrite to use SQL

Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Squashed, and added reference to new bug too
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f6f2d1ae41)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 8b04a3f642)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-01-04 20:38:48 +00:00
..
210600000.pl
210600001.pl
210600002.pl
210600003.pl
210600004.pl
210600005.pl
210600006.pl
210600007.pl
210600008.pl
210600009.pl
210600010.pl
210600011.pl
210600012.pl
210600013.pl
210600014.pl
210600015.pl
210600016.pl
210600017.pl
210600018.pl
210600019.pl
210600020.pl
210600021.pl
210600022.pl
210600023.pl
210600024.pl
210600025.pl
210600026.pl
210600027.pl
210600028.pl
210600029.pl
210600030.pl
210600031.pl
210600032.pl
210600033.pl Bug 34843: Fix database comment inconsistency on toc_request 2023-09-22 09:53:59 -10:00
210600034.pl
210600035.pl
210600036.pl
210600037.pl
210600038.pl
210600039.pl
210600040.pl
210600041.pl
210600042.pl
210600043.pl
210600044.pl
210600045.pl
210600046.pl
210600047.pl
210600048.pl
210600049.pl
211100000.pl
211200000.pl
211200001.pl
211200002.pl
211200003.pl
211200004.pl
211200005.pl
211200006.pl
211200007.pl
211200008.pl
211200009.pl
211200010.pl
211200011.pl
211200012.pl
211200013.pl
211200014.pl
211200015.pl
211200016.pl
211200017.pl
211200018.pl
211200019.pl
211200020.pl
211200021.pl
211200022.pl
211200023.pl
211200024.pl
211200025.pl
211200026.pl
211200027.pl
211200028.pl
211200029.pl
211200030.pl
211200031.pl
211200032.pl
211200033.pl
211200034.pl
211200035.pl
211200036.pl
211200037.pl
211200038.pl
211200039.pl
211200040.pl
211200041.pl
211200042.pl
211200043.pl
211200044.pl
211200045.pl
211200046.pl
211200047.pl
211200048.pl
211200049.pl
211200050.pl
211200051.pl
211200052.pl
211200053.pl
211200054.pl
211200055.pl
211200056.pl
211200057.pl
220500000.pl
220600000.pl
220600001.pl
220600002.pl
220600003.pl
220600004.pl
220600005.pl
220600006.pl
220600007.pl Bug 34684: Prevent 220600007.pl to fail if run twice 2023-09-08 09:24:29 -10:00
220600008.pl
220600009.pl
220600010.pl
220600011.pl
220600012.pl
220600013.pl
220600014.pl
220600015.pl Bug 34881: (QA follow-up) Remove stray paren 2023-10-24 20:29:48 -10:00
220600016.pl
220600017.pl
220600018.pl
220600019.pl
220600020.pl
220600021.pl
220600022.pl
220600023.pl
220600024.pl Bug 33847: Database update replaces undefined rules with defaults rather than the value that would be used 2024-01-04 20:38:48 +00:00
220600025.pl
220600026.pl
220600027.pl
220600028.pl
220600029.pl
220600030.pl
220600031.pl
220600032.pl
220600033.pl
220600034.pl
220600035.pl
220600036.pl
220600037.pl
220600038.pl
220600039.pl
220600040.pl
220600041.pl
220600042.pl
220600043.pl
220600044.pl Bug 33297: Fix typo system preference RetainPatronSearchTerms in DB revs 220600044.pl 2023-05-16 15:17:22 -03:00
220600045.pl
220600046.pl
220600047.pl
220600048.pl Bug 33671: (follow-up) Disable FK check for column change 2023-07-19 09:30:18 +01:00
220600049.pl
220600050.pl
220600051.pl
220600052.pl
220600053.pl
220600054.pl
220600055.pl
220600056.pl
220600057.pl
220600058.pl
220600059.pl
220600060.pl
220600061.pl
220600062.pl
220600063.pl
220600064.pl
220600065.pl
220600066.pl
220600067.pl
220600068.pl
220600069.pl
220600070.pl
220600071.pl
220600072.pl Bug 35064: Extra parenthesis in db_revs/220600072.pl 2023-10-24 21:27:18 -10:00
220600073.pl
220600074.pl
220600075.pl Bug 33051: Make 22600075.pl idempotent 2023-02-24 16:40:05 -03:00
220600076.pl
220600077.pl
220600078.pl
220600079.pl
220600080.pl
220600081.pl
220600082.pl
220600083.pl
220600084.pl
220600085.pl
221100000.pl
221200000.pl
221200001.pl
221200002.pl Bug 27424: (QA follow-up) Make db update idempotent 2023-07-12 07:58:36 +01:00
221200003.pl Bug 34589: Only update users if permission is added 2023-09-17 22:43:34 -10:00
221200004.pl Bug 30642: Fix dbrev permissions 2023-02-14 09:41:47 -03:00
221200005.pl Bug 31051: DBRev 22.12.00.005 2023-02-22 10:03:38 -03:00
221200006.pl Bug 22428: DBRev 22.12.00.006 2023-02-24 17:52:22 -03:00
221200007.pl Bug 32967: DBRev 22.12.00.007 2023-02-24 17:52:25 -03:00
221200008.pl Bug 33004: DBRev 22.12.00.008 2023-02-27 13:08:08 -03:00
221200009.pl Bug 32799: DBRev 22.12.00.009 2023-02-27 13:08:11 -03:00
221200010.pl 23.05.00: Fix db_revs 2023-05-31 16:09:49 -03:00
221200011.pl 23.05.00: Fix db_revs 2023-05-31 16:09:49 -03:00
221200012.pl Bug 30624: DBRev 22.12.00.012 2023-03-13 15:49:36 -03:00
221200013.pl 23.05.00: Fix db_revs 2023-05-31 16:09:49 -03:00
221200014.pl Bug 30555: (follow-up) Add messages about the introduced changes 2023-03-20 09:39:58 -03:00
221200015.pl Bug 3150: DBRev 22.12.00.015 2023-03-27 12:49:49 +02:00
221200016.pl Bug 32437: DBRev 22.12.00.016 2023-03-31 13:13:32 +02:00
221200017.pl Bug 31123: DBRev 22.12.00.017 2023-04-06 10:45:02 -03:00
221200018.pl Bug 34720: Fix bug 30403 atomic update 2023-09-22 10:00:34 -10:00
221200019.pl Bug 33368: DBRev 22.12.00.019 2023-04-06 12:53:25 -03:00
221200020.pl Bug 33192: DBRev 22.12.00.020 2023-04-14 11:35:42 -03:00
221200021.pl 23.05.00: Fix db_revs 2023-05-31 16:09:49 -03:00
221200022.pl Bug 12029: DBRev 22.12.00.022 2023-04-20 15:48:49 -03:00
221200023.pl Bug 33300: DBRev 22.12.00.023 2023-04-24 10:43:23 -03:00
221200024.pl Bug 33128: DBRev 22.12.00.024 2023-04-24 10:43:46 -03:00
221200025.pl Bug 32745: DBRev 22.12.00.025 2023-05-05 09:13:31 -03:00
221200026.pl Bug 34276: (bug 21983 follow-up) Fix db rev 23.06.00.002 2023-09-07 14:28:15 -10:00
221200027.pl Bug 33262: DBRev 22.12.00.027 2023-05-05 10:18:35 -03:00
221200028.pl 23.05.00: Fix db_revs 2023-05-31 16:09:49 -03:00
221200029.pl Bug 33197: DBRev 22.12.00.029 2023-05-05 10:18:55 -03:00
221200030.pl Bug 33053: DBRev 22.12.00.030 2023-05-05 17:45:15 -03:00
221200031.pl Bug 33673: DBRev 22.12.00.031 2023-05-09 12:45:02 -03:00
221200032.pl Bug 30928: DBRev 22.12.00.032 2023-05-10 14:19:23 -03:00
221200033.pl Bug 28328: DBRev 22.12.00.033 2023-05-10 15:26:18 -03:00
221200034.pl Bug 33557: DBRev 22.12.00.034 2023-05-10 15:26:26 -03:00
221200035.pl Bug 33567: DBRev 22.12.00.035 2023-05-12 11:22:43 -03:00
221200036.pl Bug 31557: DBRev 22.12.00.036 2023-05-12 11:22:49 -03:00
221200037.pl Bug 31212: DBRev 22.12.00.037 2023-05-12 17:50:00 -03:00
221200038.pl Bug 33489: (QA follow-up) Add missing index prefix in DBRev 2023-05-17 10:25:11 -03:00
221200039.pl Bug 32357: DBRev 22.12.00.039 2023-05-12 17:50:06 -03:00
221200040.pl Bug 33488: DBRev 22.12.00.040 2023-05-12 17:50:11 -03:00
221200041.pl Bug 34033: (bug 30649 follow-up) Fix update typos 2023-07-17 13:15:21 +01:00
221200042.pl Bug 30418: DBRev 22.12.00.042 2023-05-15 18:24:00 -03:00
221200043.pl Bug 21330: DBRev 22.12.00.043 2023-05-15 18:24:05 -03:00
221200044.pl Bug 11844: DBRev 22.12.00.044 2023-05-16 09:34:12 -03:00
221200045.pl Bug 33297: DBRev 22.12.00.045 2023-05-16 15:17:25 -03:00
221200046.pl Bug 30358: DBRev 22.12.00.046 2023-05-16 15:17:27 -03:00
221200047.pl Bug 32450: DBRev 22.12.00.047 2023-05-17 10:25:10 -03:00
221200048.pl Bug 29046: DBRev 22.12.00.048 2023-05-18 12:13:44 -03:00
230500000.pl Koha 23.05.00 is here! 2023-05-31 16:10:08 -03:00
230500001.pl Bug 33697: DBRev 23.05.00.001 2023-06-09 11:22:16 -03:00
230500002.pl Bug 34276: (bug 21983 follow-up) Fix db rev 23.06.00.002 2023-09-07 14:28:15 -10:00
230500003.pl Bug 32478: DBRev 23.05.00.003 2023-06-09 16:05:07 -03:00
230501000.pl Increment version for 23.05.01 release 2023-06-28 15:03:28 +02:00
230501001.pl Bug 33961: DBRev 23.05.01.001 2023-07-17 08:21:04 +01:00
230501002.pl Bug 33117: Make dbrev idempotent 2023-08-07 10:56:54 -10:00
230501003.pl Bug 34516: Upgrade database fails for 22.11.07.003, points to web installer 2023-12-14 21:13:45 +00:00
230502000.pl Increment version for 23.05.02 release 2023-07-28 11:10:11 -10:00
230502001.pl Bug 33028: DBRev 23.05.01.004 2023-08-07 20:05:43 -10:00
230502002.pl Bug 30451: DBRev 23.05.02.002 2023-08-17 08:48:01 -10:00
230503000.pl Increment version for 23.05.03 release 2023-08-29 10:59:08 -10:00
230503001.pl Bug 34789: (follow-up) Fix atomic update file 2023-09-20 19:56:56 -10:00
230503002.pl Bug 34844: DBRev 23.05.03.002 2023-09-22 09:27:03 -10:00
230503003.pl Bug 34843: DBRev 23.05.03.003 2023-09-22 09:54:52 -10:00
230503004.pl Bug 34720: DBRev 23.05.03.004 2023-09-22 10:01:17 -10:00
230503005.pl Bug 34748: DBRev 23.05.03.005 2023-09-25 09:16:51 -10:00
230504000.pl Increment version for 23.05.04 release 2023-09-28 08:07:03 -10:00
230504001.pl Bug 34520: DBRev 23.05.04.001 2023-11-02 10:15:48 -10:00
230505000.pl Increment version for 23.05.05 release 2023-11-07 20:34:30 -10:00
230505001.pl Bug 35190: DBRev 23.06.00.062 2023-11-09 20:54:36 -10:00
230505002.pl Bug 34557: DBRev 23.05.05.002 2023-11-10 10:53:39 -10:00
230505003.pl Bug 34328: DBRev 23.05.05.003 2023-11-10 15:24:33 -10:00
230506000.pl Increment version for 23.05.06 release 2023-11-28 08:24:48 -10:00
230507000.pl Increment version for 23.05.07 release 2024-01-03 14:06:44 +00:00