5 description => "Add a way to define overlay rules for incoming MARC records",
8 my ($dbh, $out) = @$args{qw(dbh out)};
9 unless ( TableExists('marc_overlay_rules') ) {
11 CREATE TABLE IF NOT EXISTS `marc_overlay_rules` (
12 `id` int(11) NOT NULL auto_increment,
13 `tag` varchar(255) NOT NULL, -- can be regexp, so need > 3 chars
14 `module` varchar(127) NOT NULL,
15 `filter` varchar(255) NOT NULL,
16 `add` TINYINT(1) NOT NULL DEFAULT 0,
17 `append` TINYINT(1) NOT NULL DEFAULT 0,
18 `remove` TINYINT(1) NOT NULL DEFAULT 0,
19 `delete` TINYINT(1) NOT NULL DEFAULT 0,
21 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
24 say $out "Added new table 'marc_overlay_rules'";
28 INSERT IGNORE INTO systempreferences (`variable`, `value`, `options`, `explanation`, `type`) VALUES (
32 'Use the MARC record overlay rules system to decide what actions to take for each field when modifying records.',
36 say $out "Added new system preferences 'MARCOverlayRules'";
39 INSERT IGNORE INTO permissions (module_bit, code, description) VALUES (
41 'manage_marc_overlay_rules',
42 'Manage MARC overlay rules configuration'
45 say $out "Added new permissions 'manage_marc_overlay_rules'";