Bug 11401: DBRev 3.17.00.055
authorTomas Cohen Arazi <tomascohen@gmail.com>
Fri, 14 Nov 2014 12:46:07 +0000 (09:46 -0300)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Fri, 14 Nov 2014 12:46:07 +0000 (09:46 -0300)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>

installer/data/mysql/updatedatabase.pl
kohaversion.pl

index ecc16a8..3542685 100755 (executable)
@@ -8835,31 +8835,6 @@ if ( CheckVersion($DBversion) ) {
     SetVersion ($DBversion);
 }
 
-$DBversion = "3.17.00.XXX";
-if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
-    $dbh->do("INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('NorwegianPatronDBEnable', '0', NULL, 'Enable communication with the Norwegian national patron database.', 'YesNo')");
-    $dbh->do("INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('NorwegianPatronDBEndpoint', '', NULL, 'Which NL endpoint to use.', 'Free')");
-    $dbh->do("INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('NorwegianPatronDBUsername', '', NULL, 'Username for communication with the Norwegian national patron database.', 'Free')");
-    $dbh->do("INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('NorwegianPatronDBPassword', '', NULL, 'Password for communication with the Norwegian national patron database.', 'Free')");
-    $dbh->do("INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('NorwegianPatronDBSearchNLAfterLocalHit','0',NULL,'Search NL if a search has already given one or more local hits?.','YesNo')");
-    $dbh->do("
-CREATE TABLE borrower_sync (
-    borrowersyncid int(11) NOT NULL AUTO_INCREMENT,
-    borrowernumber int(11) NOT NULL,
-    synctype varchar(32) NOT NULL,
-    sync tinyint(1) NOT NULL DEFAULT '0',
-    syncstatus varchar(10) DEFAULT NULL,
-    lastsync varchar(50) DEFAULT NULL,
-    hashed_pin varchar(64) DEFAULT NULL,
-    PRIMARY KEY (borrowersyncid),
-    KEY borrowernumber (borrowernumber),
-    CONSTRAINT borrower_sync_ibfk_1 FOREIGN KEY (borrowernumber) REFERENCES borrowers (borrowernumber) ON DELETE CASCADE ON UPDATE CASCADE
-) ENGINE=InnoDB DEFAULT CHARSET=utf8"
-);
-    print "Upgrade to $DBversion done (Bug 11401 - Add support for Norwegian national library card)\n";
-    SetVersion($DBversion);
-}
-
 $DBversion = "3.17.00.031";
 if ( CheckVersion($DBversion) ) {
    $dbh->do("ALTER TABLE saved_sql CHANGE report_name report_name VARCHAR( 255 ) NOT NULL DEFAULT '' ");
@@ -9505,6 +9480,31 @@ if (CheckVersion($DBversion)) {
     SetVersion($DBversion);
 }
 
+$DBversion = "3.17.00.055";
+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+    $dbh->do("INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('NorwegianPatronDBEnable', '0', NULL, 'Enable communication with the Norwegian national patron database.', 'YesNo')");
+    $dbh->do("INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('NorwegianPatronDBEndpoint', '', NULL, 'Which NL endpoint to use.', 'Free')");
+    $dbh->do("INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('NorwegianPatronDBUsername', '', NULL, 'Username for communication with the Norwegian national patron database.', 'Free')");
+    $dbh->do("INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('NorwegianPatronDBPassword', '', NULL, 'Password for communication with the Norwegian national patron database.', 'Free')");
+    $dbh->do("INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('NorwegianPatronDBSearchNLAfterLocalHit','0',NULL,'Search NL if a search has already given one or more local hits?.','YesNo')");
+    $dbh->do("
+CREATE TABLE borrower_sync (
+    borrowersyncid int(11) NOT NULL AUTO_INCREMENT,
+    borrowernumber int(11) NOT NULL,
+    synctype varchar(32) NOT NULL,
+    sync tinyint(1) NOT NULL DEFAULT '0',
+    syncstatus varchar(10) DEFAULT NULL,
+    lastsync varchar(50) DEFAULT NULL,
+    hashed_pin varchar(64) DEFAULT NULL,
+    PRIMARY KEY (borrowersyncid),
+    KEY borrowernumber (borrowernumber),
+    CONSTRAINT borrower_sync_ibfk_1 FOREIGN KEY (borrowernumber) REFERENCES borrowers (borrowernumber) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8"
+);
+    print "Upgrade to $DBversion done (Bug 11401 - Add support for Norwegian national library card)\n";
+    SetVersion($DBversion);
+}
+
 =head1 FUNCTIONS
 
 =head2 TableExists($table)
index d478f69..bc7cbf9 100644 (file)
@@ -16,7 +16,7 @@ the kohaversion is divided in 4 parts :
 use strict;
 
 sub kohaversion {
-    our $VERSION = '3.17.00.054';
+    our $VERSION = '3.17.00.055';
     # version needs to be set this way
     # so that it can be picked up by Makefile.PL
     # during install