| Summary: | suggestions.suggesteddate has a problematic default value | ||
|---|---|---|---|
| Product: | Koha | Reporter: | Galen Charlton <gmcharlt> |
| Component: | Architecture, internals, and plumbing | Assignee: | Galen Charlton <gmcharlt> |
| Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
| Severity: | normal | ||
| Priority: | P5 - low | CC: | fridolin.somers |
| Version: | Main | ||
| Hardware: | All | ||
| OS: | All | ||
| GIT URL: | Initiative type: | --- | |
| Sponsorship status: | --- | Crowdfunding goal: | 0 |
| Patch complexity: | Trivial patch | Documentation contact: | |
| Documentation submission: | Text to go in the release notes: | ||
| Version(s) released in: | Circulation function: | ||
| Bug Depends on: | |||
| Bug Blocks: | 7365, 13012 | ||
| Attachments: |
Bug 11391: drop default value on suggestions.suggesteddate column
Bug 11391: (follow-up) update DBIC schema classes Bug 11391: drop default value on suggestions.suggesteddate column Bug 11391: (follow-up) update DBIC schema classes Bug 11391: drop default value on suggestions.suggesteddate column Bug 11391: (follow-up) update DBIC schema classes |
||
|
Description
Galen Charlton
2013-12-13 00:54:21 UTC
Sadly, CURRENT_DATE itself cannot be used, as MySQL a non-constant default value only for timestamp columns. Created attachment 23498 [details] [review] 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> Created attachment 23499 [details] [review] 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> Created attachment 23763 [details] [review] 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 Created attachment 23764 [details] [review] 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> Created attachment 23779 [details] [review] 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> Created attachment 23780 [details] [review] 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> Pushed to master. Patches pushed to 3.14.x, will be in 3.14.2. (created version 3.14.01.003) |