View | Details | Raw Unified | Return to bug 31028
Collapse All | Expand All

(-)a/installer/data/mysql/atomicupdate/bug_31028.pl (+48 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number => "31028",
5
    description => "Add a way to record users concerns about catalog records",
6
    up => sub {
7
        my ($args) = @_;
8
        my ($dbh, $out) = @$args{qw(dbh out)};
9
        unless ( TableExists('tickets') ) {
10
            $dbh->do(q{
11
                CREATE TABLE IF NOT EXISTS `tickets` (
12
                  `id` int(11) NOT NULL auto_increment COMMENT 'primary key',
13
                  `reporter_id` int(11) NOT NULL DEFAULT 0 COMMENT 'id of the patron who reported the ticket',
14
                  `reported_date` timestamp NOT NULL DEFAULT current_timestamp() COMMENT 'date and time this ticket was reported',
15
                  `title` text NOT NULL COMMENT 'ticket title',
16
                  `body` text NOT NULL COMMENT 'ticket details',
17
                  `resolver_id` int(11) DEFAULT NULL COMMENT 'id of the user who resolved the ticket',
18
                  `resolved_date` datetime DEFAULT NULL COMMENT 'date and time this ticket was resolved',
19
                  `biblio_id` int(11) DEFAULT NULL COMMENT 'id of biblio linked',
20
                  PRIMARY KEY(`id`),
21
                  CONSTRAINT `tickets_ibfk_1` FOREIGN KEY (`reporter_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE,
22
                  CONSTRAINT `tickets_ibfk_2` FOREIGN KEY (`resolver_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE,
23
                  CONSTRAINT `tickets_ibfk_3` FOREIGN KEY (`biblio_id`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE
24
                ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
25
            });
26
27
            say $out "Added new table 'tickets'";
28
        }
29
30
        unless ( TableExists('ticket_updates') ) {
31
            $dbh->do(q{
32
                CREATE TABLE IF NOT EXISTS `ticket_updates` (
33
                  `id` int(11) NOT NULL auto_increment COMMENT 'primary key',
34
                  `ticket_id` int(11) NOT NULL COMMENT 'id of catalog ticket the update relates to',
35
                  `user_id` int(11) NOT NULL DEFAULT 0 COMMENT 'id of the user who logged the update',
36
                  `public` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'boolean flag to denote whether this update is public',
37
                  `date` timestamp NOT NULL DEFAULT current_timestamp() COMMENT 'date and time this update was logged',
38
                  `message` text NOT NULL COMMENT 'update message content',
39
                  PRIMARY KEY(`id`),
40
                  CONSTRAINT `ticket_updates_ibfk_1` FOREIGN KEY (`ticket_id`) REFERENCES `tickets` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
41
                  CONSTRAINT `ticket_updates_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE
42
                ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
43
            });
44
45
            say $out "Added new table 'ticket_updates'";
46
        }
47
    }
48
}
(-)a/installer/data/mysql/kohastructure.sql (-1 / +43 lines)
Lines 5735-5740 CREATE TABLE `tags_index` ( Link Here
5735
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
5735
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
5736
/*!40101 SET character_set_client = @saved_cs_client */;
5736
/*!40101 SET character_set_client = @saved_cs_client */;
5737
5737
5738
--
5739
-- Table structure for table `tickets`
5740
--
5741
5742
DROP TABLE IF EXISTS `tickets`;
5743
/*!40101 SET @saved_cs_client     = @@character_set_client */;
5744
/*!40101 SET character_set_client = utf8 */;
5745
CREATE TABLE IF NOT EXISTS `tickets` (
5746
  `id` int(11) NOT NULL auto_increment COMMENT 'primary key',
5747
  `reporter_id` int(11) NOT NULL DEFAULT 0 COMMENT 'id of the patron who reported the ticket',
5748
  `reported_date` timestamp NOT NULL DEFAULT current_timestamp() COMMENT 'date and time this ticket was reported',
5749
  `title` text NOT NULL COMMENT 'ticket title',
5750
  `body` text NOT NULL COMMENT 'ticket details',
5751
  `resolver_id` int(11) DEFAULT NULL COMMENT 'id of the user who resolved the ticket',
5752
  `resolved_date` datetime DEFAULT NULL COMMENT 'date and time this ticket was resolved',
5753
  `biblio_id` int(11) DEFAULT NULL COMMENT 'id of biblio linked',
5754
  PRIMARY KEY(`id`),
5755
  CONSTRAINT `tickets_ibfk_1` FOREIGN KEY (`reporter_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE,
5756
  CONSTRAINT `tickets_ibfk_2` FOREIGN KEY (`resolver_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE,
5757
  CONSTRAINT `tickets_ibfk_3` FOREIGN KEY (`biblio_id`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE
5758
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
5759
/*!40101 SET character_set_client = @saved_cs_client */;
5760
5761
--
5762
-- Table structure for table `ticket_updates`
5763
--
5764
5765
DROP TABLE IF EXISTS `ticket_updates`;
5766
/*!40101 SET @saved_cs_client     = @@character_set_client */;
5767
/*!40101 SET character_set_client = utf8 */;
5768
CREATE TABLE IF NOT EXISTS `ticket_updates` (
5769
  `id` int(11) NOT NULL auto_increment COMMENT 'primary key',
5770
  `ticket_id` int(11) NOT NULL COMMENT 'id of catalog ticket the update relates to',
5771
  `user_id` int(11) NOT NULL DEFAULT 0 COMMENT 'id of the user who logged the update',
5772
  `public` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'boolean flag to denote whether this update is public',
5773
  `date` timestamp NOT NULL DEFAULT current_timestamp() COMMENT 'date and time this update was logged',
5774
  `message` text NOT NULL COMMENT 'update message content',
5775
  PRIMARY KEY(`id`),
5776
  CONSTRAINT `ticket_updates_ibfk_1` FOREIGN KEY (`ticket_id`) REFERENCES `tickets` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
5777
  CONSTRAINT `ticket_updates_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE
5778
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
5779
/*!40101 SET character_set_client = @saved_cs_client */;
5780
5738
--
5781
--
5739
-- Table structure for table `tmp_holdsqueue`
5782
-- Table structure for table `tmp_holdsqueue`
5740
--
5783
--
5741
- 

Return to bug 31028