Bug 21682: Add update DB entry for existing installs
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 31 Oct 2018 18:36:21 +0000 (15:36 -0300)
committerNick Clemens <nick@bywatersolutions.com>
Thu, 1 Nov 2018 19:00:35 +0000 (19:00 +0000)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
installer/data/mysql/atomicupdate/bug_21682.perl [new file with mode: 0644]

diff --git a/installer/data/mysql/atomicupdate/bug_21682.perl b/installer/data/mysql/atomicupdate/bug_21682.perl
new file mode 100644 (file)
index 0000000..a5429c9
--- /dev/null
@@ -0,0 +1,9 @@
+$DBversion = 'XXX';  # will be replaced by the RM
+if( CheckVersion( $DBversion ) ) {
+    # you can use $dbh here like:
+    $dbh->do( "ALTER TABLE stockrotationrotas CHANGE COLUMN description description text" );
+
+    # Always end with this (adjust the bug info)
+    SetVersion( $DBversion );
+    print "Upgrade to $DBversion done (Bug 21682 - Remove default on stockrotationrotas.description)\n";
+}