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>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
This commit is contained in:
Galen Charlton 2013-12-13 01:06:12 +00:00
parent 930f4f393e
commit a6b2f6a161
2 changed files with 10 additions and 1 deletions

View File

@ -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

View File

@ -7859,6 +7859,15 @@ if ( CheckVersion($DBversion) ) {
ALTER TABLE collections_tracking CHANGE ctId collections_tracking_id integer(11) NOT NULL auto_increment;
});
print "Upgrade to $DBversion done (Bug 11384) - change name of collections_tracker.ctId column)\n";
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);
}