Bugzilla – Attachment 23763 Details for
Bug 11391
suggestions.suggesteddate has a problematic default value
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11391: drop default value on suggestions.suggesteddate column
Bug-11391-drop-default-value-on-suggestionssuggest.patch (text/plain), 2.92 KB, created by
Chris Cormack
on 2013-12-22 21:59:24 UTC
(
hide
)
Description:
Bug 11391: drop default value on suggestions.suggesteddate column
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2013-12-22 21:59:24 UTC
Size:
2.92 KB
patch
obsolete
>From 1329ffc8916ce689023c1164cc977571276a5fc3 Mon Sep 17 00:00:00 2001 >From: Galen Charlton <gmc@esilibrary.com> >Date: Fri, 13 Dec 2013 01:06:12 +0000 >Subject: [PATCH] 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 >--- > installer/data/mysql/kohastructure.sql | 2 +- > installer/data/mysql/updatedatabase.pl | 9 +++++++++ > 2 files changed, 10 insertions(+), 1 deletion(-) > >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 3c5d9b0..c995c43 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -2147,7 +2147,7 @@ DROP TABLE IF EXISTS `suggestions`; > CREATE TABLE `suggestions` ( -- purchase suggestions > `suggestionid` int(8) NOT NULL auto_increment, -- unique identifier assigned automatically by Koha > `suggestedby` int(11) NOT NULL default 0, -- borrowernumber for the person making the suggestion, foreign key linking to the borrowers table >- `suggesteddate` date NOT NULL default 0, -- date the suggestion was submitted >+ `suggesteddate` date NOT NULL, -- date the suggestion was submitted > `managedby` int(11) default NULL, -- borrowernumber for the librarian managing the suggestion, foreign key linking to the borrowers table > `manageddate` date default NULL, -- date the suggestion was updated > acceptedby INT(11) default NULL, -- borrowernumber for the librarian who accepted the suggestion, foreign key linking to the borrowers table >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 78074f3..ae9dc45 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -7853,6 +7853,15 @@ if ( CheckVersion($DBversion) ) { > SetVersion ($DBversion); > } > >+$DBversion = "3.15.00.XXX"; >+if ( CheckVersion($DBversion) ) { >+ $dbh->do(q{ >+ ALTER TABLE suggestions MODIFY suggesteddate DATE NOT NULL >+ }); >+ print "Upgrade to $DBversion done (Bug 11391) - drop default value on suggestions.suggesteddate column)\n"; >+ SetVersion($DBversion); >+} >+ > =head1 FUNCTIONS > > =head2 TableExists($table) >-- >1.8.3.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 11391
:
23498
|
23499
|
23763
|
23764
|
23779
|
23780