Browse Source

Bug 31028: Add `tickets` and `ticket_updates` tables

This patch adds the new `tickets` and `ticket_updates` tables for
tracking catalog concern tickets.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Helen Oliver <HOliver@tavi-port.ac.uk>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
23.05.x
Martin Renvoize 2 years ago
committed by Tomas Cohen Arazi
parent
commit
6cb12854ae
  1. 48
      installer/data/mysql/atomicupdate/bug_31028.pl
  2. 43
      installer/data/mysql/kohastructure.sql

48
installer/data/mysql/atomicupdate/bug_31028.pl

@ -0,0 +1,48 @@
use Modern::Perl;
return {
bug_number => "31028",
description => "Add a way to record users concerns about catalog records",
up => sub {
my ($args) = @_;
my ($dbh, $out) = @$args{qw(dbh out)};
unless ( TableExists('tickets') ) {
$dbh->do(q{
CREATE TABLE IF NOT EXISTS `tickets` (
`id` int(11) NOT NULL auto_increment COMMENT 'primary key',
`reporter_id` int(11) NOT NULL DEFAULT 0 COMMENT 'id of the patron who reported the ticket',
`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',
`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',
PRIMARY KEY(`id`),
CONSTRAINT `tickets_ibfk_1` FOREIGN KEY (`reporter_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `tickets_ibfk_2` FOREIGN KEY (`resolver_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `tickets_ibfk_3` FOREIGN KEY (`biblio_id`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
});
say $out "Added new table 'tickets'";
}
unless ( TableExists('ticket_updates') ) {
$dbh->do(q{
CREATE TABLE IF NOT EXISTS `ticket_updates` (
`id` int(11) NOT NULL auto_increment COMMENT 'primary key',
`ticket_id` int(11) NOT NULL COMMENT 'id of catalog ticket the update relates to',
`user_id` int(11) NOT NULL DEFAULT 0 COMMENT 'id of the user who logged the update',
`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',
PRIMARY KEY(`id`),
CONSTRAINT `ticket_updates_ibfk_1` FOREIGN KEY (`ticket_id`) REFERENCES `tickets` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `ticket_updates_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
});
say $out "Added new table 'ticket_updates'";
}
}
}

43
installer/data/mysql/kohastructure.sql

@ -5735,6 +5735,49 @@ CREATE TABLE `tags_index` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `tickets`
--
DROP TABLE IF EXISTS `tickets`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE IF NOT EXISTS `tickets` (
`id` int(11) NOT NULL auto_increment COMMENT 'primary key',
`reporter_id` int(11) NOT NULL DEFAULT 0 COMMENT 'id of the patron who reported the ticket',
`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',
`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',
PRIMARY KEY(`id`),
CONSTRAINT `tickets_ibfk_1` FOREIGN KEY (`reporter_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `tickets_ibfk_2` FOREIGN KEY (`resolver_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `tickets_ibfk_3` FOREIGN KEY (`biblio_id`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `ticket_updates`
--
DROP TABLE IF EXISTS `ticket_updates`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE IF NOT EXISTS `ticket_updates` (
`id` int(11) NOT NULL auto_increment COMMENT 'primary key',
`ticket_id` int(11) NOT NULL COMMENT 'id of catalog ticket the update relates to',
`user_id` int(11) NOT NULL DEFAULT 0 COMMENT 'id of the user who logged the update',
`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',
PRIMARY KEY(`id`),
CONSTRAINT `ticket_updates_ibfk_1` FOREIGN KEY (`ticket_id`) REFERENCES `tickets` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `ticket_updates_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `tmp_holdsqueue`
--

Loading…
Cancel
Save