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

(-)a/installer/data/mysql/atomicupdate/bug_31028.pl (+30 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('catalog_concerns') ) {
10
            $dbh->do(q{
11
                CREATE TABLE IF NOT EXISTS `catalog_concerns` (
12
                  `id` int(11) NOT NULL auto_increment COMMENT 'primary key',
13
                  `biblio_id` int(11) NOT NULL COMMENT 'id of biblio record the report concerns',
14
                  `reporter_id` int(11) NOT NULL DEFAULT 0 COMMENT 'id of the patron who reported the concern',
15
                  `reported_date` timestamp NOT NULL DEFAULT current_timestamp() COMMENT 'date and time this concern was reported',
16
                  `message` text NOT NULL COMMENT 'concern message content',
17
                  `resolver_id` int(11) DEFAULT NULL COMMENT 'id of the user who resolved the concern',
18
                  `resolved_date` datetime DEFAULT NULL COMMENT 'date and time this concern was resolved',
19
                  `resolution_message` text DEFAULT NULL COMMENT 'resolution message content',
20
                  PRIMARY KEY(`id`),
21
                  CONSTRAINT `catalog_concerns_ibfk_1` FOREIGN KEY (`biblio_id`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE,
22
                  CONSTRAINT `catalog_concerns_ibfk_2` FOREIGN KEY (`reporter_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE,
23
                  CONSTRAINT `catalog_concerns_ibfk_3` FOREIGN KEY (`resolver_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE
24
                ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
25
            });
26
27
            say $out "Added new table 'catalog_concerns'";
28
        }
29
    },
30
}
(-)a/installer/data/mysql/kohastructure.sql (-1 / +23 lines)
Lines 1643-1648 CREATE TABLE `cash_registers` ( Link Here
1643
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1643
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1644
/*!40101 SET character_set_client = @saved_cs_client */;
1644
/*!40101 SET character_set_client = @saved_cs_client */;
1645
1645
1646
--
1647
-- Table structure for table `catalog_concerns`
1648
--
1649
1650
DROP TABLE IF EXISTS `catalog_concerns`;
1651
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1652
/*!40101 SET character_set_client = utf8 */;
1653
CREATE TABLE IF NOT EXISTS `catalog_concerns` (
1654
  `id` int(11) NOT NULL auto_increment COMMENT 'primary key',
1655
  `biblio_id` int(11) NOT NULL COMMENT 'id of biblio record the report concerns',
1656
  `reporter_id` int(11) NOT NULL DEFAULT 0 COMMENT 'id of the patron who reported the concern',
1657
  `reported_date` timestamp NOT NULL DEFAULT current_timestamp() COMMENT 'date and time this concern was reported',
1658
  `message` text NOT NULL COMMENT 'concern message content',
1659
  `resolver_id` int(11) DEFAULT NULL COMMENT 'id of the user who resolved the concern',
1660
  `resolved_date` datetime DEFAULT NULL COMMENT 'date and time this concern was resolved',
1661
  `resolution_message` text DEFAULT NULL COMMENT 'resolution message content',
1662
  PRIMARY KEY(`id`),
1663
  CONSTRAINT `catalog_concerns_ibfk_1` FOREIGN KEY (`biblio_id`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE,
1664
  CONSTRAINT `catalog_concerns_ibfk_2` FOREIGN KEY (`reporter_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE,
1665
  CONSTRAINT `catalog_concerns_ibfk_3` FOREIGN KEY (`resolver_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE
1666
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1667
/*!40101 SET character_set_client = @saved_cs_client */;
1668
1646
--
1669
--
1647
-- Table structure for table `categories`
1670
-- Table structure for table `categories`
1648
--
1671
--
1649
- 

Return to bug 31028