[Bug 10039] New: the systempreferences.variable column should be a unique key
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10039 Bug ID: 10039 Summary: the systempreferences.variable column should be a unique key Classification: Unclassified Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: gmcharlt@gmail.com Reporter: gmcharlt@gmail.com Existing code assumes that the systempreference.variable column is a unique key, but this isn't enforced at the database level. This should be tightened up to avoid potential bugs if multiple rows for the same system preference slip in. One consequence of making systempreferences.variable a UK is that scripts (including upgrade scripts) that insert sysprefs should avoid spurious UK violation errors. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10039 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au --- Comment #1 from David Cook <dcook@prosentient.com.au> --- (In reply to comment #0)
Existing code assumes that the systempreference.variable column is a unique key, but this isn't enforced at the database level.
This should be tightened up to avoid potential bugs if multiple rows for the same system preference slip in.
One consequence of making systempreferences.variable a UK is that scripts (including upgrade scripts) that insert sysprefs should avoid spurious UK violation errors.
Perhaps I'm confused, but isn't systempreference.variable already the primary key of the systempreference table, which automatically makes it unique? If I look at my DB or kohastructure.sql (at line 2008 of master), it says it's the primary key, and if I try to insert sysprefs using updatedatabase.pl, sysprefs.sql, or manually with a query editor, it always prevents duplication. Am I missing something? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10039 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@biblibre.co | |m --- Comment #2 from Jonathan Druart <jonathan.druart@biblibre.com> --- (In reply to comment #1)
Perhaps I'm confused, but isn't systempreference.variable already the primary key of the systempreference table, which automatically makes it unique?
Same conclusion here, the variable names are already unique. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10039 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl --- Comment #3 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to comment #2)
Same conclusion here, the variable names are already unique. These primary keys nowadays are no longer what they used to be :)
-- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10039 Galen Charlton <gmcharlt@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |INVALID --- Comment #4 from Galen Charlton <gmcharlt@gmail.com> --- (In reply to comment #3)
(In reply to comment #2)
Same conclusion here, the variable names are already unique. These primary keys nowadays are no longer what they used to be :)
I don't trust them! In the cold light of today, I have no idea why I opened this. I can only assume that I had run into a database that had dropped the PK for some reason. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org