Commit Graph

1201 Commits

Author SHA1 Message Date
Jonathan Druart e7855c0c01
Bug 41409: Add COMMENT to kohastructure
To fix misc4dev/run_tests.pl --run-db-compare-only

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-03-05 12:56:26 -07:00
Lucas Gass a37d887df6
Bug 23260: Fix kohastructure.sql
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-03-05 08:33:48 -07:00
Nick Clemens ab5efb97a4
Bug 23260: Database updates and new system preferences AnonymizeLastBorrower / AnonymizeLastBorrowerDays
This patch alters the items_last_borrowers table to allow for NULL borrowers

It also adds two new system preferences to allow controlling the anonymization of items_last_borrower data

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Peter Moore <peter@mrcpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-03-05 08:33:44 -07:00
Nick Clemens 5ea97b7dd5
Bug 36506: Database update
Sponsored-by: The Main Library Alliance <https://www.mainlib.org/>
Signed-off-by: Trevor Diamond <trevor.diamond@mainlib.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-02-27 11:38:44 -07:00
Lucas Gass f2721c8be3
Bug 28530: (RM follow-up) Move kohastructure update to right place alphabetically
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-02-10 10:51:43 -07:00
Martin Renvoize 30fd316872
Bug 28530: (QA follow-up) Add POD documentation and database index
- Add comprehensive POD documentation for lowest_ratio_library() method
  including parameter descriptions, return values, and algorithm explanation
- Add database index on itemtype column in library_float_limits table
  to improve query performance when searching by itemtype

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-02-10 10:51:42 -07:00
Kyle M Hall cababbbd87
Bug 28530: Update database, add new schema file
Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Kris Becker <kbecker@jcls.org>
Signed-off-by: Kris Becker <kbecker@jcls.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-02-10 10:51:33 -07:00
Martin Renvoize f5bc5be08d
Bug 3492: Database migration for hold fees to circulation rules
This commit adds the database migration to move hold fee configuration
from patron categories to circulation rules, providing more granular
control over hold fees based on patron category, item type, and branch.

The migration:
- Creates circulation rules for existing categories.reservefee values
- Removes the deprecated reservefee column from categories table

Sponsored-by: OpenFifth <https://openfifth.co.uk>
Signed-off-by: Jackie Usher <jackie.usher@westsussex.gov.uk>
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-02-09 12:57:48 -07:00
Lucas Gass 629838dea2
Bug 26993: (follow-up) Update kohastructure.sql
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-22 14:16:05 -07:00
Matt Blenkinsop f5ede57411
Bug 38061: Add a checkbox to determine whether collection table issues should be pre-selected
Test plan:
Apply the patches and update the database
1) Create a new subscription with items, there should be a checkbox at the bottom of the form to pre-select collection table issues - make sure this is checked
2) Receive some items against the subscription
3) Navigate to the collections table
4) The checkboxes should be pre-selected as per previous behaviour in Koha
5) Edit the subscription and uncheck the checkbox
6) Return to the collections table and the checkboxes should all be unchecked

Signed-off-by: Nathalie <nathalie.savarit@univ-amu.fr>
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-22 10:02:19 -07:00
Matt Blenkinsop 2234969a83
Bug 38207: Add a new payment_method column to aqbooksellers
(cherry picked from commit 881f96172a8c1b35d3e74f7f0f6aa44629578021)
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2026-01-22 09:26:04 -07:00
Matt Blenkinsop 366ce3f08e
Bug 41409: Convert streetnumber and B_streetnumber to tinytext
Test plan:
1) Run 'updatedatabase'
2) No errors should be thrown

Sponsored-by: Cheshire West and Chester Council
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-12-30 07:49:06 -07:00
Lucas Gass 30c3b6e001
25.11.00: Update kohastructure.sql
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-12-05 13:31:39 -07:00
Pedro Amorim 0aa77814c7
Bug 37893: (QA follow-up): Fix database inconsistencies:
This should pass:
perl /kohadevbox/misc4dev/run_tests.pl --instance=kohadev --db-password=password --run-db-compare-only --compare-with=HEAD

This is a squash of the following:
1) Fix charset in kohastructure.sql
2) Fix NULL => DEFAULT NULL
3) Reorder tables in kohastructure.sql
4) typos

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-18 11:21:20 -07:00
Pedro Amorim c24a5b25c5
Bug 37893: (QA follow-up): Remove file_transports database table
This was clearly a mistake due a botched rebase.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-18 11:21:15 -07:00
Pedro Amorim cf11f3863d
Bug 37893: (QA follow-up): Insert defaults to database for delimiter and terminator
Not considering here encoding here as I'm uncertain from the code if it should utf8 or ascii

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-18 11:21:13 -07:00
Martin Renvoize c1a97af67c
Bug 37893: (QA follow-up): Remove plaintext password storage from SIP2
This follow-up removes the security vulnerability of storing plaintext
passwords in the sip_accounts table. The SIP2 system now relies entirely
on Koha's secure password authentication.

Changes:
- Remove plaintext password comparison from login_core() and telnet_transport()
- Remove login_password column from sip_accounts table
- Update database schema files and atomic update
- Remove password field from API definitions and Vue form
- Update all tests to remove login_password references

Authentication now works in two stages:
1. Access control: Check if userid exists in sip_accounts (allowlist)
2. Authentication: Validate password against hash in borrowers table

This maintains SIP access control while eliminating plaintext password
storage. Staff users authenticate with their Koha password (securely hashed).

Test plan:
1. Run updated tests to verify they pass
2. Verify SIP2 authentication works with staff user credentials
3. Confirm no plaintext passwords are stored

Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-18 11:21:06 -07:00
Pedro Amorim 3866d85555
Bug 37893: (QA follow-up): Nuke server params and listeners from UI
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-18 11:21:03 -07:00
Pedro Amorim fa527ac8ff
Bug 37893: SIP2 System preference overrides
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-18 11:20:56 -07:00
Pedro Amorim 443d4a069b
Bug 37893: SIP Server params
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-18 11:20:56 -07:00
Pedro Amorim bb6f72b9f7
Bug 37893: SIP accounts screen msg regexs
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-18 11:20:55 -07:00
Pedro Amorim 103038c167
Bug 37893: SIP accounts sort bin mappings
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-18 11:20:55 -07:00
Pedro Amorim 507b90b13f
Bug 37893: SIP2 Listeners
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-18 11:20:54 -07:00
Pedro Amorim e21af8c6bc
Bug 37893: SIP accounts system preference overrides
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-18 11:20:54 -07:00
Pedro Amorim 15944a017b
Bug 37893: SIP accounts custom patron fields
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-18 11:20:53 -07:00
Pedro Amorim 36808bccb2
Bug 37893: SIP accounts custom item fields
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-18 11:20:53 -07:00
Pedro Amorim 502e416d22
Bug 37893: SIP accounts item fields
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-18 11:20:52 -07:00
Pedro Amorim 48b845f0eb
Bug 37893: SIP accounts patron attributes
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-18 11:20:52 -07:00
Pedro Amorim 20e71523b8
Bug 37893: SIP accounts - Database
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-18 11:20:47 -07:00
Pedro Amorim 9be3ec6482
Bug 37893: Database
Sponsored-by: ByWater Solutions
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-18 11:20:32 -07:00
Martin Renvoize ddd8e697b4
Bug 35451: Add record_table to additional_field_values
This patch updates the database to include a record_table field in the
additional_field_values table and adds an index on that field.

This should facilitate more performant joins.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-07 10:53:56 -07:00
Tomas Cohen Arazi 90a0c25bf9
Bug 37711: DB update
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-05 07:12:31 -07:00
Martin Renvoize 168a5a9107
Bug 20253: Add po_is_basketname field to vendor_edi_accounts table
This patch adds a new boolean field 'po_is_basketname' to the vendor_edi_accounts
table to allow configuration of how basket names are used in EDIFACT.

Changes:
- Added atomicupdate for existing installations
- Updated kohastructure.sql for new installations

Signed-off-by: Hannah Dunne-Howrie <hdunne-howrie@westminster.gov.uk>
Sponsored-by: Westminster City Council <https://www.westminster.gov.uk/>
Sponsored-by: Royal Borough of Kensington and Chelsea <https://www.rbkc.gov.uk/>
Sponsored-by: OpenFifth <https://openfifth.co.uk/>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-03 14:13:36 -07:00
Pedro Amorim 877390de6a
Bug 40529: (QA follow-up): Fix DB changes
Add UNIQUE KEY entries to table definition
The UNIQUE KEY are required as a hold group 'might have' a target hold, not 'has many' target holds.
This update and the other things this patch updates in atomicupdate + kohastructure should  fix the error thrown by command:
perl /kohadevbox/misc4dev/run_tests.pl --instance=kohadev --db-password=password --run-db-compare-only --compare-with=HEAD

This command no longer produces any errors.

Also in this patch:
Renamed table from 'hold_group_target_holds' to 'hold_groups_target_holds' and move it alphabetically to be after 'hold_groups' in kohastructure.sql
This is cleaner, as it matches the 'hold_groups' related table, and allows for alphabetical sorting on kohastructure.sql that makes sense i.e. hold_groups is created first, then hold_group_target_holds is created second with an FK to the former.

All of this passes:
prove ./t/db_dependent/Koha/Hold.t
prove ./t/db_dependent/Reserves/HoldGroup.t
prove ./t/db_dependent/Circulation*
prove ./t/db_dependent/Hold*
prove ./t/db_dependent/Reserves*

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-03 14:13:25 -07:00
Pedro Amorim 8426becada
Bug 40529: (QA follow-up): Remove hold as hold group target when reverted
If a hold that is a hold group target, i.e. it's 'waiting' or 'in transit', is reverted it needs to remove itself as its own hold group target

Tests added here as well:
prove t/db_dependent/Koha/Hold.t

Signed-off-by: Anneli Österman <anneli.osterman@koha-suomi.fi>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-03 14:13:24 -07:00
Pedro Amorim bf4e2d01aa
Bug 40529: Add hold group targets logic
Hold group target hold:
The hold that is set as the hold group's target. If a hold group has a
hold target, subsequent check-ins that would 'trap' items to the
remaining holds in the group are instead skipped.

Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-11-03 14:13:14 -07:00
Pedro Amorim dc5cee850d
Bug 40517: (QA follow-up): Fix kohstructure.sql
The order was wrong, PRIMARY KEY must come first.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-29 11:50:13 -06:00
Pedro Amorim 483578c74d
Bug 40517: Add visual_group_id to hold_groups
Signed-off-by: Anneli <anneli.osterman@koha-suomi.fi>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-29 11:50:08 -06:00
Pedro Amorim 6a7a796280
Bug 40517: DB changes
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-29 11:49:59 -06:00
Kyle M Hall 63c44cbd0e
Bug 40936: Add index for default patron sort order
The default sort order for Koha's patron search includes many columns, some of which are not indexed:

[% CASE 'name-address' %] {
"data":"me.surname:me.preferred_name:me.firstname:me.middle_name:me.othernames:me.street_number:me.address:me.address2:me.city:me.state:me.postal_code:me.country",

Depending on the number of patrons in the database, and the specific configuration of the server, this can end up generating a query that creates a temp table in the hundreds of gigabytes of data or more. Not only does this risk crashing a database server with insufficient disk space, it's also incredibly slow.

We've found a compound index prevents the issue and also makes the search much faster. InndoDB indexes have a fixed maximum length which is too small ( 3072 bytes ) to encompass the full data for all the fields we need to sort by.

The following works well as a comprise to keep the index length within the maximum:
CREATE INDEX idx_borrowers_sort_order ON borrowers (
    surname(100),        -- 400
    preferred_name(80),  -- 320
    firstname(80),       -- 320
    middle_name(50),     -- 200
    othernames(50),      -- 200
    streetnumber(20),    -- 80
    address(100),        -- 400
    address2(75),        -- 300
    city(75),            -- 300
    state(40),           -- 160
    zipcode(20),         -- 80
    country(40)          -- 160
);

Test Plan:
1) Apply this patch
2) Run updatedatabase.pl
3) Perform a patron search
4) No change in behvior should be noted!

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-16 15:20:18 -06:00
Lucas Gass 8a8a04a60e
Bug 38489: Fix structural diff
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-15 11:04:13 -06:00
Martin Renvoize a86cfe61d5
Bug 38489: Add file_transport_id to vendor_edi_accounts and migrate to new transport system
This patch adds database migration to move EDI transport configurations
from vendor_edi_accounts to the new file_transports system introduced
in Bug 39190.

Changes:
- Add file_transport_id column to vendor_edi_accounts with foreign key
- Add 'local' transport type to file_transports enum
- Remove old transport fields from vendor_edi_accounts in kohastructure
- Migration script converts existing EDI configurations to file transports
- Handles FILE -> local transport type conversion

Sponsored-by: ByWater Solutions
Signed-off-by: Hannah Dunne-Howrie <hdunne-howrie@westminster.gov.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-14 14:51:46 -06:00
Jonathan Druart a8cdee1ee7
Bug 15516: Fix DB struct diff
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-09 13:48:31 -06:00
Jonathan Druart d90780504f
Bug 39190: Fix DB struct diff
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-09 13:48:30 -06:00
Jonathan Druart 2957031428
Bug 40665: Fix DB struct diff
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-09 13:48:30 -06:00
Jonathan Druart 1a4f7ad3b1
Bug 36033: Fix DB struct diff
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-09 13:48:22 -06:00
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