[Bug 30060] New: Missing primary key on user_permissions
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30060 Bug ID: 30060 Summary: Missing primary key on user_permissions Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: ASSIGNED Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: jonathan.druart+koha@gmail.com Reporter: jonathan.druart+koha@gmail.com QA Contact: testopia@bugs.koha-community.org Blocks: 30055 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30055 [Bug 30055] Rewrite patron searches to make them use the REST API routes -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30060 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |29125 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29125 [Bug 29125] Use Koha::Patron object in C4:Utils::DataTables::Members.pm -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30060 --- Comment #1 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Without primary key DBIC is failing with something like: GET /api/v1/suggestions/managers: unhandled exception (DBIx::Class::Exception)<<DBIx::Class::ResultSource::RowParser::_resolve_collapse(): Unable to calculate a definitive collapse co lumn set for UserPermission (last member of the Borrower -> user_permissions chain): fetch more unique non-nullable columns at /kohadevbox/koha/Koha/Objects.pm line 394>> Koha::REST::Plugin::Exceptions::__ANON__ / kohadevbox/koha/Koha/REST/Plugin/Exceptions.pm (73) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30060 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30060 --- Comment #2 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 130356 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=130356&action=edit Bug 30060: Add primary key to user_permissions table -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30060 --- Comment #3 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Test plan: Execute the atomic update and confirm that the new PK has been added to the user_permissions table. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30060 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30060 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #130356|0 |1 is obsolete| | --- Comment #4 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 130360 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=130360&action=edit Bug 30060: Add primary key to user_permissions table Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30060 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30060 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #130360|0 |1 is obsolete| | --- Comment #5 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 130533 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=130533&action=edit Bug 30060: Add primary key to user_permissions table Without primary key DBIC is failing with something like: GET /api/v1/suggestions/managers: unhandled exception (DBIx::Class::Exception)<<DBIx::Class::ResultSource::RowParser::_resolve_collapse(): Unable to calculate a definitive collapse co lumn set for UserPermission (last member of the Borrower -> user_permissions chain): fetch more unique non-nullable columns at /kohadevbox/koha/Koha/Objects.pm line 394>> Koha::REST::Plugin::Exceptions::__ANON__ / kohadevbox/koha/Koha/REST/Plugin/Exceptions.pm (73) Test plan: Execute the atomic update and confirm that the new PK has been added to the user_permissions table. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30060 --- Comment #6 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Please remember guidelines for commit messages :) Do we need to worry about potentially doubled up entries? I recently managed to do that with SQL manipulations, but haven't seen it happen from within Koha -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30060 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #130533|0 |1 is obsolete| | --- Comment #7 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 130616 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=130616&action=edit Bug 30060: Add primary key to user_permissions table Without primary key DBIC is failing with something like: GET /api/v1/suggestions/managers: unhandled exception (DBIx::Class::Exception)<<DBIx::Class::ResultSource::RowParser::_resolve_collapse(): Unable to calculate a definitive collapse co lumn set for UserPermission (last member of the Borrower -> user_permissions chain): fetch more unique non-nullable columns at /kohadevbox/koha/Koha/Objects.pm line 394>> Koha::REST::Plugin::Exceptions::__ANON__ / kohadevbox/koha/Koha/REST/Plugin/Exceptions.pm (73) Test plan: Execute the atomic update and confirm that the new PK has been added to the user_permissions table. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30060 --- Comment #8 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 130617 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=130617&action=edit Bug 30060: (follow-up) Remove duplicate prior to adding key I had issues with this update as somehow my user_permissions table contained duplicate rows which throws an error when adding the new primary key. This follow-up patch adds SQL to remove any duplicate rows prior to adding the new primary key. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30060 --- Comment #9 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Thanks for the follow-up, Martin. However I don't think the "temp" column is needed. See installer/data/mysql/db_revs/210600012.pl where we delete duplicate from language tables. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30060 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com --- Comment #10 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- (In reply to Jonathan Druart from comment #9)
Thanks for the follow-up, Martin. However I don't think the "temp" column is needed. See installer/data/mysql/db_revs/210600012.pl where we delete duplicate from language tables.
Hmm, the difference here is that there is no incrementing key field in the table to start with.. I couldn't work out how to do it without creating the temporary field. More than happy to be corrected, but the approach in update you point to matches the approach I have here.. it relies on an incrementing key field which we don't have here until I add it temporarily. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30060 --- Comment #11 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- (In reply to Martin Renvoize from comment #10)
(In reply to Jonathan Druart from comment #9)
Thanks for the follow-up, Martin. However I don't think the "temp" column is needed. See installer/data/mysql/db_revs/210600012.pl where we delete duplicate from language tables.
Hmm, the difference here is that there is no incrementing key field in the table to start with.. I couldn't work out how to do it without creating the temporary field. More than happy to be corrected, but the approach in update you point to matches the approach I have here.. it relies on an incrementing key field which we don't have here until I add it temporarily.
Indeed! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30060 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |22.05.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30060 --- Comment #12 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to master for 22.05, thanks to everybody involved 🦄 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30060 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |RESOLVED Resolution|--- |FIXED CC| |kyle@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30060 Magnus Enger <magnus@libriotech.no> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=30276 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30060 Magnus Enger <magnus@libriotech.no> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |magnus@libriotech.no --- Comment #13 from Magnus Enger <magnus@libriotech.no> --- This db update is giving me an error when I try to upgrade a gitified install to current master. Reported as bug 30276. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30060 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |30276 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30276 [Bug 30276] Web-based installer failing on db upgrade for 30060 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30060 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|jonathan.druart+koha@gmail. |nick@bywatersolutions.com |com | --- Comment #14 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- DBrev does not work, please have a look at bug 30276. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30060 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |30912 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30912 [Bug 30912] Database update fails for 21.12.00.016 Bug 30060 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30060 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl --- Comment #15 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> ---
From ML:
- Upgrade to 21.12.00.016 [04:05:32]: Bug 30060 - Update user_permissions to add primary key and remove null option from code column ERROR: {UNKNOWN}: DBI Exception: DBD::mysql::db do failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IF EXISTS `PRIMARY`' at line 1 at /usr/share/koha/lib/C4/Installer.pm line 739 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30060 --- Comment #16 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- (In reply to Marcel de Rooy from comment #15)
From ML:
- Upgrade to 21.12.00.016 [04:05:32]: Bug 30060 - Update user_permissions to add primary key and remove null option from code column ERROR: {UNKNOWN}: DBI Exception: DBD::mysql::db do failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IF EXISTS `PRIMARY`' at line 1 at /usr/share/koha/lib/C4/Installer.pm line 739
See bug 30912. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30060 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |29958 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29958 [Bug 29958] Missing dateaccessioned is set to today when storing an item -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30060 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks|29958 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29958 [Bug 29958] Missing dateaccessioned is set to today when storing an item -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org