https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42386

--- Comment #96 from Tomás Cohen Arazi (tcohen) <[email protected]> ---
Created attachment 209851
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209851&action=edit
Bug 42386: DB update - Migrate error_code ENUM to snake_case

This patch migrates the club_holds_to_patron_holds.error_code ENUM
from camelCase to the snake_case status codes returned by the
availability classes. It also adds the statuses the wrappers can
return but the ENUM did not accept (already_possession, recall,
branch_not_in_hold_group, pickup_not_in_hold_group, no_item_available,
no_items). Storing one of those used to make Koha::Club::Hold::add die.

The atomic update:
1. Expands the ENUM to accept both old and new values
2. Updates existing rows from old to new
3. Shrinks the ENUM to only snake_case values

Test plan:
1. Apply patch
2. Run:
   $ ktd --shell
  k$ updatedatabase
=> SUCCESS: ENUM migrated
3. Apply the DBIC schema patch and run:
  k$ prove t/db_dependent/Koha/Club/Hold.t \
           t/db_dependent/api/v1/clubs_holds.t
=> SUCCESS: Tests pass!
4. Sign off :-D

Co-authored-by: Martin Renvoize <[email protected]>
Assisted-by: Opus 5.5 (Anthropic)

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to