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

Return to bug 31028