From 901fdd8891ce9eb542899137ae894dcbb710a272 Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Tue, 16 Aug 2022 20:40:24 +0000 Subject: [PATCH] Bug 31374: Database/Schema update Signed-off-by: David Nind Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi --- Koha/Schema/Result/Suggestion.pm | 9 +++++++++ .../data/mysql/atomicupdate/bug_31374.pl | 20 +++++++++++++++++++ installer/data/mysql/kohastructure.sql | 1 + 3 files changed, 30 insertions(+) create mode 100755 installer/data/mysql/atomicupdate/bug_31374.pl diff --git a/Koha/Schema/Result/Suggestion.pm b/Koha/Schema/Result/Suggestion.pm index 6acb143b84..f822dc1a4f 100644 --- a/Koha/Schema/Result/Suggestion.pm +++ b/Koha/Schema/Result/Suggestion.pm @@ -136,6 +136,13 @@ is the suggestion archived? note entered on the suggestion +=head2 privatenote + + data_type: 'longtext' + is_nullable: 1 + +non-public note entered on the suggestion + =head2 author data_type: 'varchar' @@ -326,6 +333,8 @@ __PACKAGE__->add_columns( { data_type => "tinyint", default_value => 0, is_nullable => 0 }, "note", { data_type => "longtext", is_nullable => 1 }, + "privatenote", + { data_type => "longtext", is_nullable => 1 }, "author", { data_type => "varchar", is_nullable => 1, size => 80 }, "title", diff --git a/installer/data/mysql/atomicupdate/bug_31374.pl b/installer/data/mysql/atomicupdate/bug_31374.pl new file mode 100755 index 0000000000..861a71f856 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_31374.pl @@ -0,0 +1,20 @@ +use Modern::Perl; + +return { + bug_number => "31374", + description => "Add a non-public note cololumn to the suggestions table", + up => sub { + my ($args) = @_; + my ($dbh, $out) = @$args{qw(dbh out)}; + if( !column_exists( 'suggestions', 'privatenote' ) ) { + $dbh->do(q{ + ALTER TABLE suggestions + ADD COLUMN privatenote longtext NULL DEFAULT NULL + COMMENT "suggestions table non-public note" + AFTER note + }); + } + # Print useful stuff here + say $out "Add privatenote column to suggestions table"; + }, +}; diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index affa80e9c2..6462f21116 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -5185,6 +5185,7 @@ CREATE TABLE `suggestions` ( `STATUS` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'suggestion status (ASKED, CHECKED, ACCEPTED, REJECTED, ORDERED, AVAILABLE or a value from the SUGGEST_STATUS authorised value category)', `archived` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'is the suggestion archived?', `note` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'note entered on the suggestion', + `privatenote` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'non-public note entered on the suggestion', `author` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'author of the suggested item', `title` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'title of the suggested item', `copyrightdate` smallint(6) DEFAULT NULL COMMENT 'copyright date of the suggested item', -- 2.39.5