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

(-)a/installer/data/mysql/atomicupdate/bug_34355-add_marc_order_accounts.pl (+43 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number => "34355",
5
    description => "Add a table to allow creation of MARC order accounts and a syspref to activate it.",
6
    up => sub {
7
        my ($args) = @_;
8
        my ($dbh, $out) = @$args{qw(dbh out)};
9
10
        unless( TableExists('marc_order_accounts') ) {
11
            $dbh->do(q{
12
                CREATE TABLE `marc_order_accounts` (
13
                `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'unique identifier and primary key',
14
                `description` varchar(250) NOT NULL COMMENT 'description of this account',
15
                `vendor_id` int(11) DEFAULT NULL COMMENT 'vendor id for this account',
16
                `budget_id` int(11) DEFAULT NULL COMMENT 'budget id for this account',
17
                `download_directory` mediumtext DEFAULT NULL COMMENT 'download directory for this account',
18
                `matcher_id` int(11) DEFAULT NULL COMMENT 'the id of the match rule used (matchpoints.matcher_id)',
19
                `overlay_action` varchar(50) DEFAULT NULL COMMENT 'how to handle duplicate records',
20
                `nomatch_action` varchar(50) DEFAULT NULL COMMENT 'how to handle records where no match is found',
21
                `item_action` varchar(50) DEFAULT NULL COMMENT 'what to do with item records',
22
                `parse_items` tinyint(1) DEFAULT NULL COMMENT 'should items be parsed',
23
                `record_type` varchar(50) DEFAULT NULL COMMENT 'type of record in the file',
24
                `encoding` varchar(50) DEFAULT NULL COMMENT 'file encoding',
25
                PRIMARY KEY (`id`),
26
                CONSTRAINT `marc_ordering_account_ibfk_1` FOREIGN KEY (`vendor_id`) REFERENCES `aqbooksellers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
27
                CONSTRAINT `marc_ordering_account_ibfk_2` FOREIGN KEY (`budget_id`) REFERENCES `aqbudgets` (`budget_id`) ON DELETE CASCADE ON UPDATE CASCADE
28
                ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
29
            });
30
31
            say $out "Added new table 'marc_order_accounts'";
32
        } else {
33
            say $out "Table 'marc_order_accounts' already exists";
34
        }
35
36
        $dbh->do(
37
            q{
38
            INSERT IGNORE INTO systempreferences (variable, value, options, explanation, type) VALUES ('MarcOrderingAutomation', '0', 'NULL', 'Enables automatic order line creation from MARC records', 'YesNo');
39
            }
40
        );
41
42
    },
43
};
(-)a/installer/data/mysql/kohastructure.sql (+26 lines)
Lines 4479-4484 CREATE TABLE `marc_modification_templates` ( Link Here
4479
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4479
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4480
/*!40101 SET character_set_client = @saved_cs_client */;
4480
/*!40101 SET character_set_client = @saved_cs_client */;
4481
4481
4482
--
4483
-- Table structure for table `marc_order_accounts`
4484
--
4485
4486
DROP TABLE IF EXISTS `marc_order_accounts`;
4487
/*!40101 SET @saved_cs_client     = @@character_set_client */;
4488
/*!40101 SET character_set_client = utf8 */;
4489
CREATE TABLE `marc_order_accounts` (
4490
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'unique identifier and primary key',
4491
  `description` varchar(250) NOT NULL COMMENT 'description of this account',
4492
  `vendor_id` int(11) DEFAULT NULL COMMENT 'vendor id for this account',
4493
  `budget_id` int(11) DEFAULT NULL COMMENT 'budget id for this account',
4494
  `download_directory` mediumtext DEFAULT NULL COMMENT 'download directory for this account',
4495
  `matcher_id` int(11) DEFAULT NULL COMMENT 'the id of the match rule used (matchpoints.matcher_id)',
4496
  `overlay_action` varchar(50) DEFAULT NULL COMMENT 'how to handle duplicate records',
4497
  `nomatch_action` varchar(50) DEFAULT NULL COMMENT 'how to handle records where no match is found',
4498
  `item_action` varchar(50) DEFAULT NULL COMMENT 'what to do with item records',
4499
  `parse_items` tinyint(1) DEFAULT NULL COMMENT 'should items be parsed',
4500
  `record_type` varchar(50) DEFAULT NULL COMMENT 'type of record in the file',
4501
  `encoding` varchar(50) DEFAULT NULL COMMENT 'file encoding',
4502
  PRIMARY KEY (`id`),
4503
  CONSTRAINT `marc_ordering_account_ibfk_1` FOREIGN KEY (`vendor_id`) REFERENCES `aqbooksellers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
4504
  CONSTRAINT `marc_ordering_account_ibfk_2` FOREIGN KEY (`budget_id`) REFERENCES `aqbudgets` (`budget_id`) ON DELETE CASCADE ON UPDATE CASCADE
4505
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4506
/*!40101 SET character_set_client = @saved_cs_client */;
4507
4482
--
4508
--
4483
-- Table structure for table `marc_overlay_rules`
4509
-- Table structure for table `marc_overlay_rules`
4484
--
4510
--
(-)a/installer/data/mysql/mandatory/sysprefs.sql (-1 / +1 lines)
Lines 398-403 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
398
('MarcFieldForModifierName','',NULL,'Where to store the name of the record''s last modifier','Free'),
398
('MarcFieldForModifierName','',NULL,'Where to store the name of the record''s last modifier','Free'),
399
('MarcFieldsToOrder','',NULL,'Set the mapping values for a new order line created from a MARC record in a staged file. In a YAML format.','textarea'),
399
('MarcFieldsToOrder','',NULL,'Set the mapping values for a new order line created from a MARC record in a staged file. In a YAML format.','textarea'),
400
('MarcItemFieldsToOrder','',NULL,'Set the mapping values for new item records created from a MARC record in a staged file. In a YAML format.','textarea'),
400
('MarcItemFieldsToOrder','',NULL,'Set the mapping values for new item records created from a MARC record in a staged file. In a YAML format.','textarea'),
401
('MarcOrderingAutomation','0',NULL,'Enables automatic order line creation from MARC records','YesNo'),
401
('MARCOrgCode','OSt','','Define MARC Organization Code for MARC21 records - http://www.loc.gov/marc/organizations/orgshome.html','free'),
402
('MARCOrgCode','OSt','','Define MARC Organization Code for MARC21 records - http://www.loc.gov/marc/organizations/orgshome.html','free'),
402
('MARCOverlayRules','0',NULL,'Use the MARC record overlay rules system to decide what actions to take for each field when modifying records.','YesNo'),
403
('MARCOverlayRules','0',NULL,'Use the MARC record overlay rules system to decide what actions to take for each field when modifying records.','YesNo'),
403
('MarkLostItemsAsReturned','batchmod,moredetail,cronjob,additem,pendingreserves,onpayment','claim_returned|batchmod|moredetail|cronjob|additem|pendingreserves|onpayment','Mark items as returned when flagged as lost','multiple'),
404
('MarkLostItemsAsReturned','batchmod,moredetail,cronjob,additem,pendingreserves,onpayment','claim_returned|batchmod|moredetail|cronjob|additem|pendingreserves|onpayment','Mark items as returned when flagged as lost','multiple'),
404
- 

Return to bug 34355