Bug 7718 - Remove itemnumber column from serials table
authorKyle M Hall <kyle@bywatersolutions.com>
Mon, 4 Feb 2013 13:16:58 +0000 (08:16 -0500)
committerGalen Charlton <gmc@esilibrary.com>
Wed, 22 May 2013 15:44:31 +0000 (08:44 -0700)
Remove the column 'itemnumber' from the table 'serial'. This is
a 1 to many relationship, and this reference does not make sense.
The 'serialitems' table handles the relationship between the 'items'
table and the 'serial' table.

Test Plan:
1) Apply patch
2) Run updatedatabase.pl
3) Verify serial.itemnumber has been removed from the database

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Column removed. No errors.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
installer/data/mysql/kohastructure.sql
installer/data/mysql/updatedatabase.pl

index 7cea46e..ca2f2b2 100644 (file)
@@ -1900,7 +1900,6 @@ CREATE TABLE `serial` (
   `planneddate` date default NULL,
   `notes` text,
   `publisheddate` date default NULL,
-  `itemnumber` text default NULL,
   `claimdate` date default NULL,
   `routingnotes` text,
   PRIMARY KEY  (`serialid`)
index e609f5b..206dbd7 100755 (executable)
@@ -6942,6 +6942,13 @@ if ( CheckVersion($DBversion) ) {
    SetVersion ($DBversion);
 }
 
+$DBversion ="3.13.00.XXX";
+if ( CheckVersion($DBversion) ) {
+    $dbh->do("ALTER TABLE serial DROP itemnumber");
+    print "Upgrade to $DBversion done (Bug 7718 - Remove itemnumber column from serials table)\n";
+    SetVersion($DBversion);
+}
+
 =head1 FUNCTIONS
 
 =head2 TableExists($table)