[Koha-bugs] [Bug 30912] Database update fails for 21.12.00.016 Bug 30060

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Jun 9 14:58:58 CEST 2022


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

--- Comment #5 from Nick Clemens <nick at bywatersolutions.com> ---
Created attachment 135880
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=135880&action=edit
Bug 30912: [alternate] Drop primary key only if exists

To test:
1 - Have koha running with MySQL 8
2 - sudo koha-mysql kohadev
3 - To confirm current indexes:
    SHOW INDEXES FROM user_permissions WHERE Key_name = 'PRIMARY';
4 - Drop them to ensure the update will run
    ALTER TABLE user_permissions DROP INDEX `PRIMARY`;
5 - Run the DB update (using attached script) and ensure it works when there is
no key
6 - Drop the key again
   ALTER TABLE user_permissions DROP INDEX `PRIMARY`;
7 - Create new index that will still trigger update
   ALTER TABLE user_permissions ADD CONSTRAINT PK_borrowernumber_module_code
PRIMARY KEY (borrowernumber,module_bit);
8 - Run update again and ensure it works when there is a key

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list