From ff8b030970e6e404a777418043994da3e55c9b7c Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 9 Nov 2017 12:21:11 -0300 Subject: [PATCH] Bug 7317: DBRev 17.06.000.028 Signed-off-by: Jonathan Druart --- Koha.pm | 2 +- .../data/mysql/atomicupdate/bug_7317_ill.perl | 69 ------------------- installer/data/mysql/updatedatabase.pl | 69 +++++++++++++++++++ 3 files changed, 70 insertions(+), 70 deletions(-) delete mode 100644 installer/data/mysql/atomicupdate/bug_7317_ill.perl diff --git a/Koha.pm b/Koha.pm index 4669c9502a..aa1f63d127 100644 --- a/Koha.pm +++ b/Koha.pm @@ -29,7 +29,7 @@ use vars qw{ $VERSION }; # - #4 : the developer version. The 4th number is the database subversion. # used by developers when the database changes. updatedatabase take care of the changes itself # and is automatically called by Auth.pm when needed. -$VERSION = "17.06.00.027"; +$VERSION = "17.06.00.028"; sub version { return $VERSION; diff --git a/installer/data/mysql/atomicupdate/bug_7317_ill.perl b/installer/data/mysql/atomicupdate/bug_7317_ill.perl deleted file mode 100644 index 4757d0994f..0000000000 --- a/installer/data/mysql/atomicupdate/bug_7317_ill.perl +++ /dev/null @@ -1,69 +0,0 @@ -$DBversion = 'XXX'; -if( CheckVersion( $DBversion ) ) { - - if ( !TableExists( 'illrequests' ) ) { - $dbh->do(q{ - CREATE TABLE illrequests ( - illrequest_id serial PRIMARY KEY, -- ILL request number - borrowernumber integer DEFAULT NULL, -- Patron associated with request - biblio_id integer DEFAULT NULL, -- Potential bib linked to request - branchcode varchar(50) NOT NULL, -- The branch associated with the request - status varchar(50) DEFAULT NULL, -- Current Koha status of request - placed date DEFAULT NULL, -- Date the request was placed - replied date DEFAULT NULL, -- Last API response - updated timestamp DEFAULT CURRENT_TIMESTAMP -- Last modification to request - ON UPDATE CURRENT_TIMESTAMP, - completed date DEFAULT NULL, -- Date the request was completed - medium varchar(30) DEFAULT NULL, -- The Koha request type - accessurl varchar(500) DEFAULT NULL, -- Potential URL for accessing item - cost varchar(20) DEFAULT NULL, -- Cost of request - notesopac text DEFAULT NULL, -- Patron notes attached to request - notesstaff text DEFAULT NULL, -- Staff notes attached to request - orderid varchar(50) DEFAULT NULL, -- Backend id attached to request - backend varchar(20) DEFAULT NULL, -- The backend used to create request - CONSTRAINT `illrequests_bnfk` - FOREIGN KEY (`borrowernumber`) - REFERENCES `borrowers` (`borrowernumber`) - ON UPDATE CASCADE ON DELETE CASCADE, - CONSTRAINT `illrequests_bcfk_2` - FOREIGN KEY (`branchcode`) - REFERENCES `branches` (`branchcode`) - ON UPDATE CASCADE ON DELETE CASCADE - ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; - }); - } - - if ( !TableExists( 'illrequestattributes' ) ) { - $dbh->do(q{ - CREATE TABLE illrequestattributes ( - illrequest_id bigint(20) unsigned NOT NULL, -- ILL request number - type varchar(200) NOT NULL, -- API ILL property name - value text NOT NULL, -- API ILL property value - PRIMARY KEY (`illrequest_id`,`type`), - CONSTRAINT `illrequestattributes_ifk` - FOREIGN KEY (illrequest_id) - REFERENCES `illrequests` (`illrequest_id`) - ON UPDATE CASCADE ON DELETE CASCADE - ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; - }); - } - - # System preferences - $dbh->do(q{ - INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES - ('ILLModule','0','If ON, enables the interlibrary loans module.','','YesNo'); - }); - - $dbh->do(q{ - INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES - ('ILLModuleCopyrightClearance','','70|10','Enter text to enable the copyright clearance stage of request creation. Text will be displayed','Textarea'); - }); - # userflags - $dbh->do(q{ - INSERT IGNORE INTO userflags (bit,flag,flagdesc,defaulton) VALUES - (22,'ill','The Interlibrary Loans Module',0); - }); - - SetVersion( $DBversion ); - print "Upgrade to $DBversion done (Bug 7317 - Add an Interlibrary Loan Module to Circulation and OPAC)\n"; -} diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 948b036bbc..ec4eee4f49 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -14969,6 +14969,75 @@ if( CheckVersion( $DBversion ) ) { print "Upgrade to $DBversion done (Bug 18882 - Add location code to statistics table for checkouts and renewals)\n"; } +$DBversion = '17.06.00.028'; +if( CheckVersion( $DBversion ) ) { + if ( !TableExists( 'illrequests' ) ) { + $dbh->do(q{ + CREATE TABLE illrequests ( + illrequest_id serial PRIMARY KEY, -- ILL request number + borrowernumber integer DEFAULT NULL, -- Patron associated with request + biblio_id integer DEFAULT NULL, -- Potential bib linked to request + branchcode varchar(50) NOT NULL, -- The branch associated with the request + status varchar(50) DEFAULT NULL, -- Current Koha status of request + placed date DEFAULT NULL, -- Date the request was placed + replied date DEFAULT NULL, -- Last API response + updated timestamp DEFAULT CURRENT_TIMESTAMP -- Last modification to request + ON UPDATE CURRENT_TIMESTAMP, + completed date DEFAULT NULL, -- Date the request was completed + medium varchar(30) DEFAULT NULL, -- The Koha request type + accessurl varchar(500) DEFAULT NULL, -- Potential URL for accessing item + cost varchar(20) DEFAULT NULL, -- Cost of request + notesopac text DEFAULT NULL, -- Patron notes attached to request + notesstaff text DEFAULT NULL, -- Staff notes attached to request + orderid varchar(50) DEFAULT NULL, -- Backend id attached to request + backend varchar(20) DEFAULT NULL, -- The backend used to create request + CONSTRAINT `illrequests_bnfk` + FOREIGN KEY (`borrowernumber`) + REFERENCES `borrowers` (`borrowernumber`) + ON UPDATE CASCADE ON DELETE CASCADE, + CONSTRAINT `illrequests_bcfk_2` + FOREIGN KEY (`branchcode`) + REFERENCES `branches` (`branchcode`) + ON UPDATE CASCADE ON DELETE CASCADE + ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + }); + } + + if ( !TableExists( 'illrequestattributes' ) ) { + $dbh->do(q{ + CREATE TABLE illrequestattributes ( + illrequest_id bigint(20) unsigned NOT NULL, -- ILL request number + type varchar(200) NOT NULL, -- API ILL property name + value text NOT NULL, -- API ILL property value + PRIMARY KEY (`illrequest_id`,`type`), + CONSTRAINT `illrequestattributes_ifk` + FOREIGN KEY (illrequest_id) + REFERENCES `illrequests` (`illrequest_id`) + ON UPDATE CASCADE ON DELETE CASCADE + ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + }); + } + + # System preferences + $dbh->do(q{ + INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES + ('ILLModule','0','If ON, enables the interlibrary loans module.','','YesNo'); + }); + + $dbh->do(q{ + INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES + ('ILLModuleCopyrightClearance','','70|10','Enter text to enable the copyright clearance stage of request creation. Text will be displayed','Textarea'); + }); + # userflags + $dbh->do(q{ + INSERT IGNORE INTO userflags (bit,flag,flagdesc,defaulton) VALUES + (22,'ill','The Interlibrary Loans Module',0); + }); + + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 7317 - Add an Interlibrary Loan Module to Circulation and OPAC)\n"; +} + # DEVELOPER PROCESS, search for anything to execute in the db_update directory # SEE bug 13068 # if there is anything in the atomicupdate, read and execute it. -- 2.39.5