SetVersion ($DBversion);
}
+$DBversion = "3.03.00.043";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+
+ $dbh->do("INSERT INTO authorised_values (category,authorised_value,lib,lib_opac) VALUES ('YES_NO','0','No','No')");
+ $dbh->do("INSERT INTO authorised_values (category,authorised_value,lib,lib_opac) VALUES ('YES_NO','1','Yes','Yes')");
+
+ print "Upgrade to $DBversion done ( add generic boolean YES_NO authorised_values pair )\n";
+ SetVersion ($DBversion);
+}
+
+$DBversion = '3.03.00.044';
+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+ $dbh->do("ALTER TABLE `aqbasketgroups` ADD `freedeliveryplace` TEXT NULL AFTER `deliveryplace`;");
+ print "Upgrade to $DBversion done (adding freedeliveryplace to basketgroups)\n";
+ SetVersion($DBversion);
+}
+
+$DBversion = '3.03.00.045';
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+ #Remove obsolete columns from aqbooksellers if needed
+ my $a = $dbh->selectall_hashref('SHOW columns from aqbooksellers','Field');
+ my $sqldrop="ALTER TABLE aqbooksellers DROP COLUMN ";
+ foreach(qw/deliverydays followupdays followupscancel invoicedisc nocalc specialty/) {
+ $dbh->do($sqldrop.$_) if exists $a->{$_};
+ }
+ #Remove obsolete column from aqbudgets if needed
+ #The correct column is budget_notes
+ $a = $dbh->selectall_hashref('SHOW columns from aqbudgets','Field');
+ if(exists $a->{budget_description}) {
+ $dbh->do("ALTER TABLE aqbudgets DROP COLUMN budget_description");
+ }
+ print "Upgrade to $DBversion done (Remove obsolete columns from aqbooksellers and aqbudgets if needed)\n";
+ SetVersion ($DBversion);
+}
+
+$DBversion = "3.03.00.046";
+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+ $dbh->do("ALTER TABLE overduerules ALTER delay1 SET DEFAULT NULL, ALTER delay2 SET DEFAULT NULL, ALTER delay3 SET DEFAULT NULL");
+ print "Upgrade to $DBversion done (Setting NULL default value for delayn columns in table overduerules)\n";
+ SetVersion($DBversion);
+}
+
+$DBversion = '3.03.00.047';
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+ $dbh->do("ALTER TABLE borrowers ADD `state` mediumtext AFTER city;");
+ $dbh->do("ALTER TABLE borrowers ADD `B_state` mediumtext AFTER B_city;");
+ $dbh->do("ALTER TABLE borrowers ADD `altcontactstate` mediumtext AFTER altcontactaddress3;");
+ $dbh->do("ALTER TABLE deletedborrowers ADD `state` mediumtext AFTER city;");
+ $dbh->do("ALTER TABLE deletedborrowers ADD `B_state` mediumtext AFTER B_city;");
+ $dbh->do("ALTER TABLE deletedborrowers ADD `altcontactstate` mediumtext AFTER altcontactaddress3;");
+ print "Upgrade to $DBversion done (Add state field to patron's addresses)\n";
+}
+
+$DBversion = '3.03.00.048';
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+ $dbh->do("ALTER TABLE branches ADD `branchstate` mediumtext AFTER `branchcity`;");
+ print "Upgrade to $DBversion done (Add state to branch address)\n";
+ SetVersion ($DBversion);
+}
+
=head1 FUNCTIONS
=head2 DropAllForeignKeys($table)