SetVersion($DBversion)
}
+$DBversion = "3.09.00.043";
+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+ $dbh->do("
+ ALTER TABLE aqorders
+ ADD parent_ordernumber int(11) DEFAULT NULL
+ ");
+ $dbh->do("
+ UPDATE aqorders
+ SET parent_ordernumber = ordernumber;
+ ");
+ print "Upgrade to $DBversion done (Adding parent_ordernumber in aqorders)\n";
+ SetVersion($DBversion);
+}
+
+
+$DBversion = '3.09.00.044';
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+ $dbh->do("ALTER TABLE statistics ADD COLUMN ccode VARCHAR ( 10 ) NULL AFTER associatedborrower");
+ $dbh->do("UPDATE statistics SET statistics.ccode = ( SELECT items.ccode FROM items WHERE statistics.itemnumber = items.itemnumber )");
+ $dbh->do("UPDATE statistics SET statistics.ccode = (
+ SELECT deleteditems.ccode FROM deleteditems
+ WHERE statistics.itemnumber = deleteditems.itemnumber
+ ) WHERE statistics.ccode IS NULL");
+ print "Upgrade done ( Added Collection Code to Statistics table. )\n";
+ SetVersion ($DBversion);
+}
+
+$DBversion = "3.09.00.045";
+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+ $dbh->do("ALTER TABLE borrower_attribute_types MODIFY category_code VARCHAR( 10 ) NULL DEFAULT NULL");
+ print "Upgrade to $DBversion done. (Bug 8002: Update patron attribute types table from varchar(1) to varchar(10) category_code)\nWarning to Koha System Administrators: If you use borrower attributes defined by borrower categories, you have to check your configuration. A bug may have removed your attribute links to borrower categories.\nPlease check, and fix it if necessary.";
+ SetVersion($DBversion);
+}
+
+$DBversion = "3.09.00.046";
+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+ $dbh->do("ALTER TABLE `accountlines` ADD `accountlines_id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;");
+ print "Upgrade to $DBversion done (adding accountlines_id field in accountlines table)\n";
+ SetVersion($DBversion);
+}
+
+
+$DBversion = "3.09.00.047";
+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+ # to preserve default behaviour as best as possible, set this new preference differently depending on whether IndependantBranches is set or not
+ my $prefvalue = 'anywhere';
+ if (C4::Context->preference("IndependantBranches")) { $prefvalue = 'homeorholdingbranch';}
+ $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('AllowReturnToBranch', '$prefvalue', 'Where an item may be returned', 'anywhere|homebranch|holdingbranch|homeorholdingbranch', 'Choice');");
+
+ print "Upgrade to $DBversion done: adding AllowReturnToBranch syspref (bug 6151)";
+ SetVersion($DBversion);
+}
+
+$DBversion = "3.09.00.048";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+ $dbh->do("ALTER TABLE authorised_values MODIFY lib varchar(200)");
+ $dbh->do("ALTER TABLE authorised_values MODIFY lib_opac varchar(200)");
+
+ print "Upgrade to $DBversion done (Raise the length of Authorised Values descriptions)\n";
+ SetVersion($DBversion);
+}
+
=head1 FUNCTIONS
=head2 TableExists($table)