From e122a16dbd9cc877d9509b61c46caaeda1298adf Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 21 Dec 2023 15:57:41 +0000 Subject: [PATCH] Bug 35628: Add status to tickets table Signed-off-by: Esther Melander --- .../data/mysql/atomicupdate/bug_35628.pl | 28 +++++++++++++++++++ installer/data/mysql/kohastructure.sql | 2 ++ 2 files changed, 30 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug_35628.pl diff --git a/installer/data/mysql/atomicupdate/bug_35628.pl b/installer/data/mysql/atomicupdate/bug_35628.pl new file mode 100644 index 00000000000..d8d14d46869 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_35628.pl @@ -0,0 +1,28 @@ +use Modern::Perl; + +return { + bug_number => "35626", + description => "Add statuses to catalog concerns", + up => sub { + my ($args) = @_; + my ($dbh, $out) = @$args{qw(dbh out)}; + unless( column_exists('tickets','status') ){ + $dbh->do(q{ + ALTER TABLE tickets ADD COLUMN status varchar(80) DEFAULT NULL COMMENT 'current status of the ticket' AFTER body + }); + + say $out "Added column 'tickets.status'"; + } + unless( column_exists('ticket_updates','status') ){ + $dbh->do(q{ + ALTER TABLE ticket_updates ADD COLUMN status varchar(80) DEFAULT NULL COMMENT 'status of ticket at this update' AFTER message + }); + + say $out "Added column 'ticket_updates.status'"; + } + $dbh->do(q{ + INSERT IGNORE INTO authorised_value_categories( category_name, is_system ) VALUES ('TICKET_STATUS', 1); + }); + say $out "Added TICKET_STATUS authorised value category"; + }, +}; diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 0b59ad8d85c..7e7dada360e 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -6270,6 +6270,7 @@ CREATE TABLE `ticket_updates` ( `public` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'boolean flag to denote whether this update is public', `date` timestamp NOT NULL DEFAULT current_timestamp() COMMENT 'date and time this update was logged', `message` text NOT NULL COMMENT 'update message content', + `status` varchar(80) DEFAULT NULL COMMENT 'status of ticket at this update', PRIMARY KEY (`id`), KEY `ticket_updates_ibfk_1` (`ticket_id`), KEY `ticket_updates_ibfk_2` (`user_id`), @@ -6291,6 +6292,7 @@ CREATE TABLE `tickets` ( `reported_date` timestamp NOT NULL DEFAULT current_timestamp() COMMENT 'date and time this ticket was reported', `title` text NOT NULL COMMENT 'ticket title', `body` text NOT NULL COMMENT 'ticket details', + `status` varchar(80) DEFAULT NULL COMMENT 'current status of the ticket', `resolver_id` int(11) DEFAULT NULL COMMENT 'id of the user who resolved the ticket', `resolved_date` datetime DEFAULT NULL COMMENT 'date and time this ticket was resolved', `biblio_id` int(11) DEFAULT NULL COMMENT 'id of biblio linked', -- 2.43.0