bug 5549: change to kohastructure.sql missing from commit 8cea8e5cc0

Also deletes earlier updatedatabase addition of lengthunit to avoid errors for people upgrading from stable (thanks Katrin for the idea)

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Checked creating a database from scratch and updating a database
with missing lengthunit column. Both worked without any problem.
If you update and have the column updatedatabase will report an error,
but the database will be ok.
This commit is contained in:
MJ Ray 2012-04-05 18:56:39 +01:00 committed by Paul Poulain
parent 9980aa7369
commit 0df4c6a3ac
2 changed files with 8 additions and 2 deletions

View File

@ -990,6 +990,7 @@ CREATE TABLE `issuingrules` (
`chargename` varchar(100) default NULL,
`maxissueqty` int(4) default NULL,
`issuelength` int(4) default NULL,
`lengthunit` varchar(10) default 'days',
`hardduedate` date default NULL,
`hardduedatecompare` tinyint NOT NULL default "0",
`renewalsallowed` smallint(6) NOT NULL default "0",

View File

@ -5019,7 +5019,6 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
$dbh->do("ALTER TABLE old_issues CHANGE returndate returndate datetime");
$dbh->do("ALTER TABLE old_issues CHANGE lastreneweddate lastreneweddate datetime");
$dbh->do("ALTER TABLE old_issues CHANGE issuedate issuedate datetime");
$dbh->do("alter table issuingrules add column lengthunit varchar(10) default 'days' after issuelength");
print "Upgrade to $DBversion done (Setting up issues tables for hourly loans)\n";
SetVersion($DBversion);
}
@ -5146,7 +5145,6 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
SetVersion($DBversion);
}
$DBversion = "3.07.00.045";
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
$dbh->do("ALTER TABLE import_batches MODIFY COLUMN batch_type ENUM('batch','z3950','webservice') NOT NULL default 'batch'");
@ -5154,6 +5152,13 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
SetVersion ($DBversion);
}
$DBversion = "3.07.00.046";
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
$dbh->do("ALTER TABLE issuingrules ADD COLUMN lengthunit varchar(10) DEFAULT 'days' AFTER issuelength");
print "Upgrade to $DBversion done (Setting up issues tables for hourly loans (lengthunit fix))\n";
SetVersion($DBversion);
}
=head1 FUNCTIONS
=head2 DropAllForeignKeys($table)