From 16b5ac8079b1297077b369bac025ebf9b9fc23dd Mon Sep 17 00:00:00 2001 From: Amit Gupta Date: Thu, 17 Oct 2013 21:49:30 +0530 Subject: [PATCH] Bug-4456 Adding table po_sequence --- installer/data/mysql/kohastructure.sql | 12 ++++++++++++ installer/data/mysql/sysprefs.sql | 3 ++- installer/data/mysql/updatedatabase.pl | 8 ++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index a6a779e..21c01ee 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -3313,6 +3313,18 @@ ALTER TABLE `patron_list_patrons` ADD CONSTRAINT patron_list_patrons_ibfk_2 FOREIGN KEY (borrowernumber) REFERENCES borrowers (borrowernumber) ON DELETE CASCADE ON UPDATE CASCADE; +-- +-- Table structure for table 'po_sequence' +-- + +DROP TABLE IF EXISTS po_sequence +CREATE TABLE IF NOT EXISTS po_sequence ( + seqid varchar(10) PRIMARY KEY, + seq_value bigint(20) unsigned NOT NULL, + PRIMARY KEY (seqid) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 71513ce..5b0b406 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -419,5 +419,6 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('XSLTResultsDisplay','default','','Enable XSL stylesheet control over results page display on intranet','Free'), ('yuipath','local','local|http://yui.yahooapis.com/2.5.1/build','Insert the path to YUI libraries, choose local if you use koha offline','Choice'), ('z3950AuthorAuthFields','701,702,700',NULL,'Define the MARC biblio fields for Personal Name Authorities to fill biblio.author','free'), -('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo') +('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo'), +('EnablePONumber',0,'Enable purchase order number',NULL,'YesNo') ; diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 3d2ca44..e9df767 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -7595,6 +7595,14 @@ if ( CheckVersion($DBversion) ) { SetVersion($DBversion); } +$DBversion = "3.13.00.XXX"; +if ( CheckVersion($DBversion) ) { + $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('EnablePONumber',0,'Enable purchase order number',NULL,'YesNo')"); + $dbh->do("CREATE TABLE IF NOT EXISTS po_sequence (seqid varchar(10) PRIMARY KEY, seq_value bigint(20) unsigned NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8;"); + $dbh->do(q{INSERT INTO po_sequence values('POSEQ', 1)}); + print "Upgrade to $DBversion done (Bug 4456 - Add systempreferences to enabling purchaseordernumber and create new table po_sequence)\n"; + SetVersion ($DBversion); +} =head1 FUNCTIONS -- 1.8.4.rc3