Commit Graph

1155 Commits

Author SHA1 Message Date
Martin Renvoize fdfaeda9fc
Bug 38330: (QA follow-up) Add index to opac_suppressed
As suggested by David, this one adds an index on the new column

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-29 14:02:17 -06:00
Tomas Cohen Arazi b4c7f300f6
Bug 38330: DB changes
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-29 14:02:13 -06:00
Tomas Cohen Arazi a5f72d7362
Bug 39190: Rename id => file_transport_id and remove mapping
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-19 13:23:25 -06:00
Tomas Cohen Arazi acf2f642b4
Bug 39190: Rename 'sftp_servers' to 'file_transports'
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-19 13:23:21 -06:00
Martin Renvoize 2d88bcaf1f
Bug 39190: Update status to longtext
Update status field to store longtext so we can sore more details
information about connection statuses from test connection

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-19 13:23:16 -06:00
Jake Deery 2688dfd668
Bug 35761: Database updates
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-19 13:23:03 -06:00
Paul Derscheid 1460ddc222
Bug 40665: Database update
This patch updates the database schema to add booking_id foreign key
columns to both issues and old_issues tables, enabling the linkage
between checkouts and the bookings that generated them.

Schema changes:
- Add booking_id column to issues and old_issues tables
- Add foreign key constraints referencing bookings table
- Preserve referential integrity with appropriate CASCADE actions

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-05 15:10:35 -06:00
David Cook 8e11019993
Bug 15516: (follow-up) explicitly define indexes for foreign keys
This patch explicitly defines indexes for foreign keys.

This isn't really needed for the atomic update, but we've included
it for consistency.

It is needed in kohastructure.sql, because MySQL/MariaDB silently/implicitly
adds these indexes for foreign keys, which means that the database
audit tool will show a discrepancy between kohastructure.sql and
the installed DB schema.

Also fix a discrepancy between atomic update and kohastructure.sql

Test plan:
0. Apply the patch
1. Use both methods to update the DB schema
2. Go to http://localhost:8081/cgi-bin/koha/about.pl?tab=database
3. Note that about.pl isn't telling you to drop the indexes
for reserves_ibfk_hg and old_reserves_ibfk_hg now

Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-03 11:42:04 -06:00
Aleisha Amohia 8ce7541997
Bug 15516: Database and installer updates
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-03 11:41:59 -06:00
Pedro Amorim c59514c02e
Bug 37901: Add 'illrequest_id' column to statistics
Signed-off-by: Jeremy Evans <Jeremy.Evans@ukhsa.gov.uk>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-08-20 13:43:21 -06:00
Pedro Amorim 8948896344
Bug 37901: Preparation: db changes
Signed-off-by: Jeremy Evans <Jeremy.Evans@ukhsa.gov.uk>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-08-20 13:43:18 -06:00
Shi Yao Wang 9b70f6db00
Bug 20644: Change checkprevcheckout as ENUM at DB level
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-08-20 13:43:06 -06:00
Hammat Wele 99322896b9
Bug 20644: Add checkprevcheckout on item types
I have added the "Check for previous checkouts" option to item types. This option is visible only when the system preference "CheckPrevCheckout" is set to either :
- "Unless overridden by patron category or by item type, do"
or
- "Unless overridden by patron category or by item type, do not."

This option takes precedence over patron and patron category preferences.

TEST PLAN
1) Apply the patch.
2) Perform an atomic update (installer/data/mysql/updatedatabase.pl)
3) Set the "CheckPrevCheckout" system preference to "Unless overridden by patron category or by item type, do".
4) Go to "Koha administration > Item types > + New item type".
5) Fill in the necessary fields; the "Check for previous checkouts" field should be set to "Inherit from system preferences".
6) Click the "Save changes" button.
7) Create an item with the type you have created.
8) Check out this item for a patron, then check it in.
9) Check out the same item for the same patron again.
10) The message "Patron has previously checked out this title: <Title>. Check out anyway?" should appear.
11) Go to "Koha administration > Item types".
12) Edit the created item type.
13) Change the value of the "Check for previous checkouts" field to "No and try to override system preferences".
14) Click the "Save changes" button.
15) Check out the same item for the same patron.
16) The message should not appear.
17) Run the tests "Borrower_PrevCheckout.t" (prove t/db_dependent/Patron/Borrower_PrevCheckout.t) and "ItemTypes.t" (prove t/db_dependent/Koha/ItemTypes.t).
18) Verify that all tests pass successfully.

Signed-off-by: Laurence <laurence.rault@biblibre.com>
Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-08-20 13:42:58 -06:00
Jonathan Druart ffd7a4ec10
Bug 40548: (bug 40337 follow-up): Fix DB comparison
00:40:25 koha-1       | <   `checkprevcheckout` enum('yes', 'no', 'inherit') NOT NULL DEFAULT 'inherit' COMMENT 'produce a warning for this patron if this item has previously been checked out to this patron if ''yes'', not if ''no'', defer to category setting if ''inherit''.',
00:40:25 koha-1       | ---
00:40:25 koha-1       | >   `checkprevcheckout` enum('yes','no','inherit') NOT NULL DEFAULT 'inherit' COMMENT 'produce a warning for this patron if this item has previously been checked out to this patron if ''yes'', not if ''no'', defer to category setting if ''inherit''.',
00:40:25 koha-1       | ERROR - DB structures are not identical
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2025-07-30 09:51:25 +02:00
Jonathan Druart a3b4b5cdd0
Bug 40405: Set systempreferences.value to NOT NULL
Some sysprefs have NULL as their default value, and systempreferences.value allows NULL values.

However C4::Context->set_preference does not unset a syspref if "undef" is passed.

Additionally some of the sysprefs that have NULL as default will generate warnings in the logs (and test suite output).

opac/opac-suggestions.pl:        for my $f ( split( /\s*\,\s*/, C4::Context->preference("OPACSuggestionUnwantedFields") ) ) {

Here is the current list:
+-------------------------------+-------+
| variable                      | value |
+-------------------------------+-------+
| decreaseLoanHighHoldsDuration | NULL  |
| decreaseLoanHighHoldsValue    | NULL  |
| ILLHiddenRequestStatuses      | NULL  |
| ILLOpacbackends               | NULL  |
| ILLSendStaffNotices           | NULL  |
| ListOwnerDesignated           | NULL  |
| MarcFieldDocURL               | NULL  |
| MaxFine                       | NULL  |
| OPACSuggestionUnwantedFields  | NULL  |
| ReportsExportLimit            | NULL  |
| SerialsSearchResultsLimit     | NULL  |
+-------------------------------+-------+

Test plan:
Code review required here, please confirm the above and that the
different occurrences do not use "undef" as a value.

Note that some tests now do not longer generate warnings
(eg. t/db_dependent/selenium/opac_ill_requests.t)

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-07-23 16:36:30 -06:00
Jonathan Druart 3c3cc6622c
Bug 40337: Define checkprevcheckout as ENUM
On bug 40178 and bug 40179 we defined checkprevcheckout attributes as
ENUM at the REST API level, so the specs prevent us from inserting
values that are no yes, no, inherit in DB.
However the DB schema didn't have that constraint.
This has been caught by some tests that were failing:
eg. t/db_dependent/selenium/patrons_search.t with "Not in enum list: yes, no, inherit."

Test plan:
Apply this patch, run `updatedatabase`, `dbic` and `restart_all`
`prove t/db_dependent/selenium/patrons_search.t` should now pass.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-07-10 09:43:27 -06:00
Katrin Fischer 80464afe8a
25.05.05: Update kohastructure.sql
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-05-26 18:45:49 +02:00
Matt Blenkinsop c882117b95
Bug 30301: Add a new column to enforce the expiry notice
Signed-off-by: Hanna Leiker <tech.hanna@salinapublic.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-05-19 18:54:29 +02:00
Martin Renvoize dc5e4b415b
Bug 38457: Update record_id to VARCHAR(80)
This is required to allow for long primary keys from the
account_debit_types table.

Signed-off-by: Hannah Dunne-Howrie <hdunne-howrie@westminster.gov.uk>
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-05-15 09:20:47 +02:00
Tomas Cohen Arazi fb2a4d99f5
Bug 39837: Rename (aqbookseller_interfaces) column interface_id to vendor_interface_id
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-05-13 18:47:05 +02:00
Tomas Cohen Arazi f3109d0021
Bug 39838: Rename (aqbookseller_aliases) column alias_id to vendor_alias_id
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-05-13 18:47:03 +02:00
David Cook ba3feb54ee
Bug 39618: (QA follow-up) add prefix length to index key
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-05-12 18:31:12 +02:00
Jonathan Druart 15b2565b9b
Bug 39835: columns_settings should be tinyint
They are boolean in the schema file already

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-05-06 18:48:21 +02:00
Jonathan Druart fcf679b920
Bug 39835: Modify boolean column from int(1) to tinyint(1)
This is part of our guideline and we should enforce it.

This patch also add "is_boolean => 0" for int(1) that are not boolean

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-05-06 18:48:20 +02:00
Lucas Gass 9276f33d4b
Bug 39618: Add index to borrowers.preferred_name column
To test:
1. APPLY PATCH
2. updatedatabase

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-05-06 18:48:18 +02:00
Jonathan Druart a41f52530a
Bug 39833: Adjust character_set_client in kohastructure.sql
koha-dump now generates the dump with utf8mb4

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2025-05-05 14:23:32 +02:00
Jonathan Druart 6df775d051
Bug 30888: Remove KEY origincode
koha-dump removes it

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2025-05-05 14:23:31 +02:00
Jonathan Druart 592431aed3
Bug 38689: Correctly place edifact_errors in kohastructure.sql
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2025-05-05 14:03:09 +02:00
Jonathan Druart ccc84b1a32
Bug 38663: Fix columns order in db_rev
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2025-05-05 14:03:08 +02:00
Jonathan Druart 01f842f4a7
Bug 39075: Explicit NOT NULL for timestamp
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2025-05-05 14:03:06 +02:00
Nick Clemens b805f5ff99
Bug 39325: (QA follow-up) Adjust some issues
connexion is a product, added to ignore file

tablee -> tables

a few other small corrections

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-28 18:51:30 +02:00
Jonathan Druart a82f7d19cb
Bug 39325: Adjust DB
We need to adjust kohastructure.sql, sysprefs.sql and the DB itself.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-28 18:51:26 +02:00
Matt Blenkinsop fe37b056b6
Bug 39518: Add a new column basket_name_field
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Thomas Klausner <domm@plix.at>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-25 08:46:49 +02:00
Andrew Fuerste Henry 41d781648f
Bug 39062: increase length of items.stocknumber and deleteditems.stocknumber in kohastructure.sql
To test:
1: try to save a value in the 952$i that is more than 32 characters
2: It does not work.
3: apply patch
4: try to save a value in the 952$i that is more than 32 characters
5: it does work!
6: delete your item and use a report to confirm the full string is in deleteditems.stocknumber
7: Maybe use DESCRIBE from mysql commandline to see the length and confirm it's changed?

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-22 08:46:49 +02:00
Katrin Fischer c1356f4667
Bug 37934: Extend data types for customer ID, requestor ID, and API key for ERM data providers
This changes the datatype of customer ID, requestor ID, and API key
from limited varchar to text to accustom for longer values.

To test:
* Apply the patch
* Run updatedatabase (a sandbox will do this automatically)
* Activate the ERM module in the system preferences (ERMModule)
* Go to E-ressource management > Data providers > New data provider
* Make sure you can enter values longer than 265 in the fields named
  above and that they are stored correctly.

Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-14 08:50:58 +02:00
Pedro Amorim 93c65bec84
Bug 38663: Preparation: Change record_id to varchar: database
record_if in the additional_field_values is an int(11)
This works for most cases, but in the branches case, the id column is
actually a varchar (branchcode).
This patch updates the column to accomodate for this.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-03-10 11:42:26 +01:00
Pedro Amorim a69f98a45d
Bug 32630: database changes
Sponsored-by: UKHSA - UK Health Security Agency
Signed-off-by: Jeremy Evans <Jeremy.Evans@ukhsa.gov.uk>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-03-07 18:02:59 +01:00
Martin Renvoize fc2cbb2724
Bug 38689: Add edifact_errors table
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-21 16:41:18 +01:00
Victor Grousset/tuxayo 2261e06b82
Bug 30888: add `heading` column after bug 30047 added it to auth_header
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-21 10:41:45 +01:00
Marcel de Rooy a8929c7921
Bug 30888: Db rev for new table deletedauth_header
In line with the other deleted tables. (See also bug 20271.)

Note: Removed the auto_increment for this deleted table. There is
no need for it and it could only mess up the table. Additionally,
removed the index on origin.

Test plan:
Run updatedatabase.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

[EDIT] Removed column 'marc' (BZ 26684)

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-21 10:41:45 +01:00
David Cook 8d0f1b3a18
Bug 26684: Remove marc from auth_header for new installs
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-21 10:41:41 +01:00
Victor Grousset/tuxayo d0ad8a0727
Bug 35635: (QA follow-up): fix terminology
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-20 17:34:55 +01:00
Lucas Gass 3ec2419152
Bug 35635: DB Updates
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-20 17:34:53 +01:00
Tomas Cohen Arazi 2e63ece6ae
Bug 37292: Add an index on oauth_access_tokens.expires
This patch adds a needed index to the column.

To test:
1. On a fresh KTD, run:
   $ ktd --shell
  k$ koha-mysql kohadev
   > SHOW CREATE TABLE oauth_access_tokens;
=> FAIL: There's no 'KEY' entry for the `expires` column
2. Apply this patch
3. Run:
  k$ updatedatabase
=> SUCCESS: A message tells the index was added
4. Repeat 1
=> SUCCESS: The index was actually added to the DB
5. Run:
  k$ reset_all
6. Repeat 1
=> SUCCESS: The index is created at install time too!
7. Run:
  k$ updatedatabase
=> SUCCESS: Nothing explodes, no message about index being created
8. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-12-03 17:34:03 +01:00
Andrew Fuerste Henry 73c7acd33f
Bug 38522: update kohastructure.sql
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-12-03 17:34:01 +01:00
Jonathan Druart a072d5ff47
Bug 22421: Fix KEY names
There is a mismatch in KEY names.
We should use the ones auto-generated by the server, not pass specific
ones.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-25 15:07:44 +01:00
Katrin Fischer 16d01084c1
24.11.00: Update kohastructure.sql
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-25 13:16:43 +01:00
Paul Derscheid 31517e506a
Bug 37592: (QA follow-up) Ensure consistent NOT NULL placement and make implicit behavior explicit
- Explicitly set `NOT NULL` constraints for `creation_date` and `modification_date` in `kohastructure.sql` to clarify the implicit behavior of `DEFAULT CURRENT_TIMESTAMP`.
- Adjusted the `modification_date` column definition in the atomic update file to place `NOT NULL` before `ON UPDATE` for consistency.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-25 13:16:42 +01:00
Katrin Fischer cd20298738
Bug 33641: DBRev 24.06.00.063
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-14 14:19:41 +01:00
Nick Clemens b2d02523b2
Bug 33641: (follow-up) Change return_branch to checkin_library
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-11-14 14:19:41 +01:00