Eighth installment Patron card generation feature
authorChris Nighswonger <cnighswonger@foundations.edu>
Mon, 17 Mar 2008 14:43:58 +0000 (10:43 -0400)
committerJoshua Ferraro <jmf@liblime.com>
Tue, 18 Mar 2008 01:43:11 +0000 (20:43 -0500)
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
installer/data/mysql/kohastructure.sql
installer/data/mysql/updatedatabase.pl

index 81e07f3..b7d01de 100644 (file)
@@ -1451,6 +1451,21 @@ CREATE TABLE `overduerules` (
   PRIMARY KEY  (`branchcode`,`categorycode`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
+--
+-- Table structure for table `patroncards`
+--
+
+DROP TABLE IF EXISTS `patroncards`;
+Create Table: CREATE TABLE `patroncards` (
+  `cardid` int(11) NOT NULL auto_increment,
+  `batch_id` varchar(10) NOT NULL default '1',
+  `borrowernumber` int(11) NOT NULL,
+  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+   PRIMARY KEY  (`cardid`),
+   KEY `patroncards_ibfk_1` (`borrowernumber`),
+   CONSTRAINT `patroncards_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8
+
 --
 -- Table structure for table `patronimage`
 --
index a66e2db..0e2a690 100755 (executable)
@@ -1198,6 +1198,22 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
     print "Upgrade to $DBversion done (IMPORTANT: Upgrading to Amazon.com Associates Web Service 4.0 ) ";
     SetVersion ($DBversion);
 }
+
+$DBversion = "3.00.00.065";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+    $dbh->do("Create Table: CREATE TABLE `patroncards` (
+                `cardid` int(11) NOT NULL auto_increment,
+                `batch_id` varchar(10) NOT NULL default '1',
+                `borrowernumber` int(11) NOT NULL,
+                `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+                PRIMARY KEY  (`cardid`),
+                KEY `patroncards_ibfk_1` (`borrowernumber`),
+                CONSTRAINT `patroncards_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE
+                ) ENGINE=InnoDB DEFAULT CHARSET=utf8;");
+    print "Upgrade to $DBversion done (Adding patroncards table for patroncards generation feature. ) ";
+    SetVersion ($DBversion);
+}
+
 =item DropAllForeignKeys($table)
 
   Drop all foreign keys of the table $table