Bug 13539: Remove unused table patroncards
authorKatrin Fischer <Katrin.Fischer.83@web.de>
Sun, 18 Jan 2015 21:41:23 +0000 (22:41 +0100)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Mon, 13 Apr 2015 16:18:58 +0000 (13:18 -0300)
It appears that the table patroncards hasn't been used
since the database updates for the rewritten label modules
('3.01.00.107').

It's time to remove them from the database.

As the patron card batches were needed for printing and
the data has not been accessible in a long time, it seems safe
to delete it.

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
installer/data/mysql/kohastructure.sql
installer/data/mysql/updatedatabase.pl

index 09ef8d3..a74d81a 100644 (file)
@@ -1712,21 +1712,6 @@ CREATE TABLE `overduerules` ( -- overdue notice status and triggers
   PRIMARY KEY  (`branchcode`,`categorycode`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
 
---
--- Table structure for table `patroncards`
---
-
-DROP TABLE IF EXISTS `patroncards`;
-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 COLLATE=utf8_unicode_ci;
-
 --
 -- Table structure for table `patronimage`
 --
index 0bd3ac6..d97e8f2 100755 (executable)
@@ -10018,6 +10018,13 @@ if ( CheckVersion($DBversion) ) {
     SetVersion ($DBversion);
 }
 
+$DBversion = "3.19.00.XXX";
+if ( CheckVersion($DBversion) ) {
+    $dbh->do(qq|DROP table patroncards;|);
+    print "Upgrade to $DBversion done (Bug 13539: Remove table patroncards from database as it's no longer in use)\n";
+    SetVersion ($DBversion);
+}
+
 # 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.