Bug 10021: Update DB changes
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 23 Oct 2017 15:27:33 +0000 (12:27 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 11 Dec 2017 14:34:18 +0000 (11:34 -0300)
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
installer/data/mysql/atomicupdate/bug_10021.perl [new file with mode: 0644]

diff --git a/installer/data/mysql/atomicupdate/bug_10021.perl b/installer/data/mysql/atomicupdate/bug_10021.perl
new file mode 100644 (file)
index 0000000..74b1c43
--- /dev/null
@@ -0,0 +1,14 @@
+$DBversion = 'XXX';  # will be replaced by the RM
+if( CheckVersion( $DBversion ) ) {
+
+    $dbh->do(q|DROP TABLE IF EXISTS notifys|);
+
+    if( column_exists( 'accountlines', 'notify_id' ) ) {
+        $dbh->do(q|ALTER TABLE accountlines DROP COLUMN notify_id|);
+        $dbh->do(q|ALTER TABLE accountlines DROP COLUMN notify_level|);
+    }
+
+    # Always end with this (adjust the bug info)
+    SetVersion( $DBversion );
+    print "Upgrade to $DBversion done (Bug 10021 - Drop notifys-related table and columns)\n";
+}