Bug 21411: DBRev 18.12.00.074
authorNick Clemens <nick@bywatersolutions.com>
Fri, 10 May 2019 19:05:38 +0000 (19:05 +0000)
committerNick Clemens <nick@bywatersolutions.com>
Fri, 10 May 2019 19:05:38 +0000 (19:05 +0000)
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Koha.pm
Koha/Schema/Result/KeyboardShortcut.pm [new file with mode: 0644]
installer/data/mysql/atomicupdate/Bug_21411_add_keyboard_shortcuts.perl [deleted file]
installer/data/mysql/updatedatabase.pl

diff --git a/Koha.pm b/Koha.pm
index 5a6387a..8bb2e64 100644 (file)
--- a/Koha.pm
+++ b/Koha.pm
@@ -29,7 +29,7 @@ use vars qw{ $VERSION };
 # - #4 : the developer version. The 4th number is the database subversion.
 #        used by developers when the database changes. updatedatabase take care of the changes itself
 #        and is automatically called by Auth.pm when needed.
-$VERSION = "18.12.00.073";
+$VERSION = "18.12.00.074";
 
 sub version {
     return $VERSION;
diff --git a/Koha/Schema/Result/KeyboardShortcut.pm b/Koha/Schema/Result/KeyboardShortcut.pm
new file mode 100644 (file)
index 0000000..7601e6f
--- /dev/null
@@ -0,0 +1,65 @@
+use utf8;
+package Koha::Schema::Result::KeyboardShortcut;
+
+# Created by DBIx::Class::Schema::Loader
+# DO NOT MODIFY THE FIRST PART OF THIS FILE
+
+=head1 NAME
+
+Koha::Schema::Result::KeyboardShortcut
+
+=cut
+
+use strict;
+use warnings;
+
+use base 'DBIx::Class::Core';
+
+=head1 TABLE: C<keyboard_shortcuts>
+
+=cut
+
+__PACKAGE__->table("keyboard_shortcuts");
+
+=head1 ACCESSORS
+
+=head2 shortcut_name
+
+  data_type: 'varchar'
+  is_nullable: 0
+  size: 80
+
+=head2 shortcut_keys
+
+  data_type: 'varchar'
+  is_nullable: 0
+  size: 80
+
+=cut
+
+__PACKAGE__->add_columns(
+  "shortcut_name",
+  { data_type => "varchar", is_nullable => 0, size => 80 },
+  "shortcut_keys",
+  { data_type => "varchar", is_nullable => 0, size => 80 },
+);
+
+=head1 PRIMARY KEY
+
+=over 4
+
+=item * L</shortcut_name>
+
+=back
+
+=cut
+
+__PACKAGE__->set_primary_key("shortcut_name");
+
+
+# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-05-10 19:02:44
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:pnxutghDJLyCGVkChuk2rQ
+
+
+# You can replace this text with custom code or comments, and it will be preserved on regeneration
+1;
diff --git a/installer/data/mysql/atomicupdate/Bug_21411_add_keyboard_shortcuts.perl b/installer/data/mysql/atomicupdate/Bug_21411_add_keyboard_shortcuts.perl
deleted file mode 100644 (file)
index 17c556a..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-$DBversion = 'XXX';
-if( CheckVersion( $DBversion ) ) {
-    unless ( TableExists( 'keyboard_shortcuts' ) ) {
-        $dbh->do(q|
-            CREATE TABLE keyboard_shortcuts (
-            shortcut_name varchar(80) NOT NULL,
-            shortcut_keys varchar(80) NOT NULL,
-            PRIMARY KEY (shortcut_name)
-            ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;|
-        );
-    }
-    $dbh->do(q|
-        INSERT IGNORE INTO keyboard_shortcuts (shortcut_name, shortcut_keys) VALUES
-        ("insert_copyright","Alt-C"),
-        ("insert_copyright_sound","Alt-P"),
-        ("insert_delimiter","Ctrl-D"),
-        ("subfield_help","Ctrl-H"),
-        ("link_authorities","Shift-Ctrl-L"),
-        ("delete_field","Ctrl-X"),
-        ("delete_subfield","Shift-Ctrl-X"),
-        ("new_line","Enter"),
-        ("line_break","Shift-Enter"),
-        ("next_position","Tab"),
-        ("prev_position","Shift-Tab")
-        ;|
-    );
-    $dbh->do(q|
-        INSERT IGNORE permissions (module_bit, code, description)
-        VALUES
-        (3,'manage_keyboard_shortcuts','Manage keyboard shortcuts for advanced cataloging editor')
-        ;|
-    );
-    SetVersion( $DBversion );
-    print "Upgrade to $DBversion done (Bug XXXXX - Add keyboard_shortcuts table)\n";
-}
index 162988a..da85fdc 100755 (executable)
@@ -18621,6 +18621,42 @@ if( CheckVersion( $DBversion ) ) {
     print "Upgrade to $DBversion done (Bug 5770 - Email librarian when purchase suggestion made)\n";
 }
 
+$DBversion = '18.12.00.074';
+if( CheckVersion( $DBversion ) ) {
+    unless ( TableExists( 'keyboard_shortcuts' ) ) {
+        $dbh->do(q|
+            CREATE TABLE keyboard_shortcuts (
+            shortcut_name varchar(80) NOT NULL,
+            shortcut_keys varchar(80) NOT NULL,
+            PRIMARY KEY (shortcut_name)
+            ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;|
+        );
+    }
+    $dbh->do(q|
+        INSERT IGNORE INTO keyboard_shortcuts (shortcut_name, shortcut_keys) VALUES
+        ("insert_copyright","Alt-C"),
+        ("insert_copyright_sound","Alt-P"),
+        ("insert_delimiter","Ctrl-D"),
+        ("subfield_help","Ctrl-H"),
+        ("link_authorities","Shift-Ctrl-L"),
+        ("delete_field","Ctrl-X"),
+        ("delete_subfield","Shift-Ctrl-X"),
+        ("new_line","Enter"),
+        ("line_break","Shift-Enter"),
+        ("next_position","Tab"),
+        ("prev_position","Shift-Tab")
+        ;|
+    );
+    $dbh->do(q|
+        INSERT IGNORE permissions (module_bit, code, description)
+        VALUES
+        (3,'manage_keyboard_shortcuts','Manage keyboard shortcuts for advanced cataloging editor')
+        ;|
+    );
+    SetVersion( $DBversion );
+    print "Upgrade to $DBversion done (Bug 21411 - Add keyboard_shortcuts table)\n";
+}
+
 # SEE bug 13068
 # if there is anything in the atomicupdate, read and execute it.