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 1644-1649 CREATE TABLE `cash_registers` ( Link Here
1644
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1644
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1645
/*!40101 SET character_set_client = @saved_cs_client */;
1645
/*!40101 SET character_set_client = @saved_cs_client */;
1646
1646
1647
--
1648
-- Table structure for table `catalog_concerns`
1649
--
1650
1651
DROP TABLE IF EXISTS `catalog_concerns`;
1652
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1653
/*!40101 SET character_set_client = utf8 */;
1654
CREATE TABLE IF NOT EXISTS `catalog_concerns` (
1655
  `id` int(11) NOT NULL auto_increment COMMENT 'primary key',
1656
  `biblio_id` int(11) NOT NULL COMMENT 'id of biblio record the report concerns',
1657
  `reporter_id` int(11) NOT NULL DEFAULT 0 COMMENT 'id of the patron who reported the concern',
1658
  `reported_date` timestamp NOT NULL DEFAULT current_timestamp() COMMENT 'date and time this concern was reported',
1659
  `message` text NOT NULL COMMENT 'concern message content',
1660
  `resolver_id` int(11) DEFAULT NULL COMMENT 'id of the user who resolved the concern',
1661
  `resolved_date` datetime DEFAULT NULL COMMENT 'date and time this concern was resolved',
1662
  `resolution_message` text DEFAULT NULL COMMENT 'resolution message content',
1663
  PRIMARY KEY(`id`),
1664
  CONSTRAINT `catalog_concerns_ibfk_1` FOREIGN KEY (`biblio_id`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE,
1665
  CONSTRAINT `catalog_concerns_ibfk_2` FOREIGN KEY (`reporter_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE,
1666
  CONSTRAINT `catalog_concerns_ibfk_3` FOREIGN KEY (`resolver_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE
1667
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1668
/*!40101 SET character_set_client = @saved_cs_client */;
1669
1647
--
1670
--
1648
-- Table structure for table `categories`
1671
-- Table structure for table `categories`
1649
--
1672
--
1650
- 

Return to bug 31028