From 7125c2d657cc363e7846ac6da6ac9294a436516c Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 5 Dec 2019 17:13:30 +0100 Subject: [PATCH] Bug 24156: DB changes Add a new table tables_settings to store default_display_length and default_sort_order. Signed-off-by: Liz Rea --- .../data/mysql/atomicupdate/bug_24156.perl | 18 ++++++++++++++++++ installer/data/mysql/kohastructure.sql | 13 +++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug_24156.perl diff --git a/installer/data/mysql/atomicupdate/bug_24156.perl b/installer/data/mysql/atomicupdate/bug_24156.perl new file mode 100644 index 0000000000..5bc0433397 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_24156.perl @@ -0,0 +1,18 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + unless ( TableExists( 'tables_settings' ) ) { + $dbh->do(q| + CREATE TABLE tables_settings ( + module varchar(255) NOT NULL, + page varchar(255) NOT NULL, + tablename varchar(255) NOT NULL, + default_display_length smallint(6) NOT NULL DEFAULT 20, + default_sort_order varchar(255), + PRIMARY KEY(module (191), page (191), tablename (191) ) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + |); + } + + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 24156 - Add new table tables_settings)\n"; +} diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index c5a3879662..c5ceb09c32 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -3662,6 +3662,19 @@ CREATE TABLE IF NOT EXISTS columns_settings ( PRIMARY KEY(module (191), page (191), tablename (191), columnname (191)) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +-- +-- Table structure for table `tables_settings` +-- + +CREATE TABLE IF NOT EXISTS tables_settings ( + module varchar(255) NOT NULL, + page varchar(255) NOT NULL, + tablename varchar(255) NOT NULL, + default_display_length smallint(6) NOT NULL DEFAULT 20 , + default_sort_order varchar(255), + PRIMARY KEY(module (191), page (191), tablename (191) ) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + -- -- Table structure for table 'items_search_fields' -- -- 2.20.1