From 31684a426be4dcdf75a06f1f15fcfc73726fa6ae Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Fri, 10 May 2019 19:05:38 +0000 Subject: [PATCH] Bug 21411: DBRev 18.12.00.074 Signed-off-by: Nick Clemens --- Koha.pm | 2 +- Koha/Schema/Result/KeyboardShortcut.pm | 65 +++++++++++++++++++ .../Bug_21411_add_keyboard_shortcuts.perl | 35 ---------- installer/data/mysql/updatedatabase.pl | 36 ++++++++++ 4 files changed, 102 insertions(+), 36 deletions(-) create mode 100644 Koha/Schema/Result/KeyboardShortcut.pm delete mode 100644 installer/data/mysql/atomicupdate/Bug_21411_add_keyboard_shortcuts.perl diff --git a/Koha.pm b/Koha.pm index 5a6387ab6c..8bb2e647bf 100644 --- 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 index 0000000000..7601e6f0a2 --- /dev/null +++ b/Koha/Schema/Result/KeyboardShortcut.pm @@ -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 + +=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 + +=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 index 17c556a12a..0000000000 --- a/installer/data/mysql/atomicupdate/Bug_21411_add_keyboard_shortcuts.perl +++ /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"; -} diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 162988afd2..da85fdc989 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -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. -- 2.39.5