SetVersion($DBversion);
}
+$DBversion = "3.15.00.018";
+if ( CheckVersion($DBversion) ) {
+ $dbh->{AutoCommit} = 0;
+ $dbh->{RaiseError} = 1;
+
+ my $av_added = $dbh->do(q|
+ INSERT INTO authorised_values(category, authorised_value, lib, lib_opac)
+ SELECT 'ROADTYPE', roadtypeid, road_type, road_type
+ FROM roadtype;
+ |);
+
+ my $rt_deleted = $dbh->do(q|
+ DELETE FROM roadtype
+ |);
+
+ if ( $av_added == $rt_deleted or $rt_deleted eq "0E0" ) {
+ $dbh->do(q|
+ DROP TABLE roadtype;
+ |);
+ $dbh->commit;
+ print "Upgrade to $DBversion done (Bug 7372: Move road types from the roadtype table to the ROADTYPE authorised values)\n";
+ SetVersion($DBversion);
+ } else {
+ print "Upgrade to $DBversion failed (Bug 7372: Move road types from the roadtype table to the ROADTYPE authorised values.\nTransaction aborted because $@\n)";
+ $dbh->rollback;
+ }
+
+ $dbh->{AutoCommit} = 1;
+ $dbh->{RaiseError} = 0;
+}
+
+$DBversion = "3.15.00.019";
+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+ $dbh->do("INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES('OpacMaxItemsToDisplay','50','','Max items to display at the OPAC on a biblio detail','Integer')");
+ print "Upgrade to $DBversion done (Bug 11256: Add system preference OpacMaxItemsToDisplay)\n";
+ SetVersion($DBversion);
+}
+
+$DBversion = "3.15.00.020";
+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+ $dbh->do(q|
+ INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES('MaxItemsForBatch','1000',NULL,'Max number of items record to process in a batch (modification or deletion)','Integer')
+ |);
+ print "Upgrade to $DBversion done (Bug 11343: Add system preference MaxItemsForBatch )\n";
+ SetVersion($DBversion);
+}
+
+$DBversion = "3.15.00.021";
+if(CheckVersion($DBversion)) {
+ $dbh->do(q{
+ ALTER TABLE `action_logs`
+ DROP KEY timestamp,
+ ADD KEY `timestamp_idx` (`timestamp`),
+ ADD KEY `user_idx` (`user`),
+ ADD KEY `module_idx` (`module`(255)),
+ ADD KEY `action_idx` (`action`(255)),
+ ADD KEY `object_idx` (`object`),
+ ADD KEY `info_idx` (`info`(255))
+ });
+ print "Upgrade to $DBversion done (Bug 3445: Add indexes to action_logs table)\n";
+ SetVersion($DBversion);
+}
+
=head1 FUNCTIONS
=head2 TableExists($table)