[Bug 11391] New: suggestions.suggesteddate has a problematic default value
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11391 Bug ID: 11391 Summary: suggestions.suggesteddate has a problematic default value Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: gmcharlt@gmail.com Reporter: gmcharlt@gmail.com QA Contact: testopia@bugs.koha-community.org Blocks: 7365 The column suggesteddate in the suggestions table is currently defined as "date NOT NULL default 0". When DBIx::Class translates that PostgreSQLese, it ends up as "date DEFAULT '0000-00-00' NOT NULL". Since 0000-00-00 is not a valid date, DBIC will fail to deploy the suggestions table to a Pg database. Since suggesteddate is supposed to be the date that the suggestion was submitted, CURRENT_DATE is a better default value regardless. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11391 --- Comment #1 from Galen Charlton <gmcharlt@gmail.com> --- Sadly, CURRENT_DATE itself cannot be used, as MySQL a non-constant default value only for timestamp columns. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11391 Galen Charlton <gmcharlt@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11391 --- Comment #2 from Galen Charlton <gmcharlt@gmail.com> --- Created attachment 23498 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=23498&action=edit Bug 11391: drop default value on suggestions.suggesteddate column The 'default 0' clause got translated as an invalid constant default of '0000-00-00' when DBIx::Schema is used to deploy the suggestions table into a Pg database. This patch drops the default. To test: [1] Apply the patch and run the SQL specified in the database updated. [2] Verify that the suggestions table no longer has an explicit default value for the suggesteddate column. [3] Verify that prove -v t/db_dependent/Suggestions.t passes. [4] Verify that installer/data/mysql/kohastructure.sql runs cleanly in an empty database. [5] Verify that there are no visible regressions of the purchase suggestions functionality. Signed-off-by: Galen Charlton <gmc@esilibrary.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11391 --- Comment #3 from Galen Charlton <gmcharlt@gmail.com> --- Created attachment 23499 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=23499&action=edit Bug 11391: (follow-up) update DBIC schema classes This patch updates the DBIC schema class for Suggestion to reflect the dropped default value for the suggesteddate column. To test: [1] Create an empty Pg database and use the deployment script being worked in in bug 11390. The deployment shoudl succeed without reporting any errors regarding the suggestions table. Signed-off-by: Galen Charlton <gmc@esilibrary.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11391 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #23498|0 |1 is obsolete| | --- Comment #4 from Chris Cormack <chris@bigballofwax.co.nz> --- Created attachment 23763 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=23763&action=edit Bug 11391: drop default value on suggestions.suggesteddate column The 'default 0' clause got translated as an invalid constant default of '0000-00-00' when DBIx::Schema is used to deploy the suggestions table into a Pg database. This patch drops the default. To test: [1] Apply the patch and run the SQL specified in the database updated. [2] Verify that the suggestions table no longer has an explicit default value for the suggesteddate column. [3] Verify that prove -v t/db_dependent/Suggestions.t passes. [4] Verify that installer/data/mysql/kohastructure.sql runs cleanly in an empty database. [5] Verify that there are no visible regressions of the purchase suggestions functionality. Signed-off-by: Galen Charlton <gmc@esilibrary.com> Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> Having a default of 0 on a date seems like a mad thing to do anyway, so good to get rid of it -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11391 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11391 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #23499|0 |1 is obsolete| | --- Comment #5 from Chris Cormack <chris@bigballofwax.co.nz> --- Created attachment 23764 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=23764&action=edit Bug 11391: (follow-up) update DBIC schema classes This patch updates the DBIC schema class for Suggestion to reflect the dropped default value for the suggesteddate column. To test: [1] Create an empty Pg database and use the deployment script being worked in in bug 11390. The deployment shoudl succeed without reporting any errors regarding the suggestions table. Signed-off-by: Galen Charlton <gmc@esilibrary.com> Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11391 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11391 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #23763|0 |1 is obsolete| | Attachment #23764|0 |1 is obsolete| | --- Comment #6 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 23779 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=23779&action=edit Bug 11391: drop default value on suggestions.suggesteddate column The 'default 0' clause got translated as an invalid constant default of '0000-00-00' when DBIx::Schema is used to deploy the suggestions table into a Pg database. This patch drops the default. To test: [1] Apply the patch and run the SQL specified in the database updated. [2] Verify that the suggestions table no longer has an explicit default value for the suggesteddate column. [3] Verify that prove -v t/db_dependent/Suggestions.t passes. [4] Verify that installer/data/mysql/kohastructure.sql runs cleanly in an empty database. [5] Verify that there are no visible regressions of the purchase suggestions functionality. Signed-off-by: Galen Charlton <gmc@esilibrary.com> Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> Having a default of 0 on a date seems like a mad thing to do anyway, so good to get rid of it Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11391 --- Comment #7 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 23780 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=23780&action=edit Bug 11391: (follow-up) update DBIC schema classes This patch updates the DBIC schema class for Suggestion to reflect the dropped default value for the suggesteddate column. To test: [1] Create an empty Pg database and use the deployment script being worked in in bug 11390. The deployment shoudl succeed without reporting any errors regarding the suggestions table. Signed-off-by: Galen Charlton <gmc@esilibrary.com> Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11391 Galen Charlton <gmcharlt@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #8 from Galen Charlton <gmcharlt@gmail.com> --- Pushed to master. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11391 Fridolin SOMERS <fridolyn.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable CC| |fridolyn.somers@biblibre.co | |m Patch complexity|--- |Trivial patch --- Comment #9 from Fridolin SOMERS <fridolyn.somers@biblibre.com> --- Patches pushed to 3.14.x, will be in 3.14.2. (created version 3.14.01.003) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11391 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |13012 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org