Bugzilla – Attachment 174362 Details for
Bug 34355
Automated MARC record ordering process
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34355: DB schemas and atomicupdate
Bug-34355-DB-schemas-and-atomicupdate.patch (text/plain), 6.85 KB, created by
Matt Blenkinsop
on 2024-11-11 15:23:52 UTC
(
hide
)
Description:
Bug 34355: DB schemas and atomicupdate
Filename:
MIME Type:
Creator:
Matt Blenkinsop
Created:
2024-11-11 15:23:52 UTC
Size:
6.85 KB
patch
obsolete
>From 289fdb053e46690409ddf2d688bbe5b3cb466a9b Mon Sep 17 00:00:00 2001 >From: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> >Date: Mon, 11 Nov 2024 15:20:03 +0000 >Subject: [PATCH] Bug 34355: DB schemas and atomicupdate > >Signed-off-by: Andrew Fuerste Henry <andrewfh@dubcolib.org> >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > .../bug_34355-add_marc_order_accounts.pl | 43 +++++++++++++++++++ > installer/data/mysql/kohastructure.sql | 26 +++++++++++ > installer/data/mysql/mandatory/sysprefs.sql | 1 + > 3 files changed, 70 insertions(+) > create mode 100755 installer/data/mysql/atomicupdate/bug_34355-add_marc_order_accounts.pl > >diff --git a/installer/data/mysql/atomicupdate/bug_34355-add_marc_order_accounts.pl b/installer/data/mysql/atomicupdate/bug_34355-add_marc_order_accounts.pl >new file mode 100755 >index 00000000000..f0a5f2ab216 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_34355-add_marc_order_accounts.pl >@@ -0,0 +1,43 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => "34355", >+ description => "Add a table to allow creation of MARC order accounts and a syspref to activate it.", >+ up => sub { >+ my ($args) = @_; >+ my ($dbh, $out) = @$args{qw(dbh out)}; >+ >+ unless( TableExists('marc_order_accounts') ) { >+ $dbh->do(q{ >+ CREATE TABLE `marc_order_accounts` ( >+ `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'unique identifier and primary key', >+ `description` varchar(250) NOT NULL COMMENT 'description of this account', >+ `vendor_id` int(11) DEFAULT NULL COMMENT 'vendor id for this account', >+ `budget_id` int(11) DEFAULT NULL COMMENT 'budget id for this account', >+ `download_directory` mediumtext DEFAULT NULL COMMENT 'download directory for this account', >+ `matcher_id` int(11) DEFAULT NULL COMMENT 'the id of the match rule used (matchpoints.matcher_id)', >+ `overlay_action` varchar(50) DEFAULT NULL COMMENT 'how to handle duplicate records', >+ `nomatch_action` varchar(50) DEFAULT NULL COMMENT 'how to handle records where no match is found', >+ `item_action` varchar(50) DEFAULT NULL COMMENT 'what to do with item records', >+ `parse_items` tinyint(1) DEFAULT NULL COMMENT 'should items be parsed', >+ `record_type` varchar(50) DEFAULT NULL COMMENT 'type of record in the file', >+ `encoding` varchar(50) DEFAULT NULL COMMENT 'file encoding', >+ PRIMARY KEY (`id`), >+ CONSTRAINT `marc_ordering_account_ibfk_1` FOREIGN KEY (`vendor_id`) REFERENCES `aqbooksellers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, >+ CONSTRAINT `marc_ordering_account_ibfk_2` FOREIGN KEY (`budget_id`) REFERENCES `aqbudgets` (`budget_id`) ON DELETE CASCADE ON UPDATE CASCADE >+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; >+ }); >+ >+ say $out "Added new table 'marc_order_accounts'"; >+ } else { >+ say $out "Table 'marc_order_accounts' already exists"; >+ } >+ >+ $dbh->do( >+ q{ >+ INSERT IGNORE INTO systempreferences (variable, value, options, explanation, type) VALUES ('MarcOrderingAutomation', '0', 'NULL', 'Enables automatic order line creation from MARC records', 'YesNo'); >+ } >+ ); >+ >+ }, >+}; >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 4c938daf8e1..793ce731f79 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -4479,6 +4479,32 @@ CREATE TABLE `marc_modification_templates` ( > ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; > /*!40101 SET character_set_client = @saved_cs_client */; > >+-- >+-- Table structure for table `marc_order_accounts` >+-- >+ >+DROP TABLE IF EXISTS `marc_order_accounts`; >+/*!40101 SET @saved_cs_client = @@character_set_client */; >+/*!40101 SET character_set_client = utf8 */; >+CREATE TABLE `marc_order_accounts` ( >+ `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'unique identifier and primary key', >+ `description` varchar(250) NOT NULL COMMENT 'description of this account', >+ `vendor_id` int(11) DEFAULT NULL COMMENT 'vendor id for this account', >+ `budget_id` int(11) DEFAULT NULL COMMENT 'budget id for this account', >+ `download_directory` mediumtext DEFAULT NULL COMMENT 'download directory for this account', >+ `matcher_id` int(11) DEFAULT NULL COMMENT 'the id of the match rule used (matchpoints.matcher_id)', >+ `overlay_action` varchar(50) DEFAULT NULL COMMENT 'how to handle duplicate records', >+ `nomatch_action` varchar(50) DEFAULT NULL COMMENT 'how to handle records where no match is found', >+ `item_action` varchar(50) DEFAULT NULL COMMENT 'what to do with item records', >+ `parse_items` tinyint(1) DEFAULT NULL COMMENT 'should items be parsed', >+ `record_type` varchar(50) DEFAULT NULL COMMENT 'type of record in the file', >+ `encoding` varchar(50) DEFAULT NULL COMMENT 'file encoding', >+ PRIMARY KEY (`id`), >+ CONSTRAINT `marc_ordering_account_ibfk_1` FOREIGN KEY (`vendor_id`) REFERENCES `aqbooksellers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, >+ CONSTRAINT `marc_ordering_account_ibfk_2` FOREIGN KEY (`budget_id`) REFERENCES `aqbudgets` (`budget_id`) ON DELETE CASCADE ON UPDATE CASCADE >+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; >+/*!40101 SET character_set_client = @saved_cs_client */; >+ > -- > -- Table structure for table `marc_overlay_rules` > -- >diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql >index b6a8c385ec6..f49557be9c7 100644 >--- a/installer/data/mysql/mandatory/sysprefs.sql >+++ b/installer/data/mysql/mandatory/sysprefs.sql >@@ -398,6 +398,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('MarcFieldForModifierName','',NULL,'Where to store the name of the record''s last modifier','Free'), > ('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'), > ('MarcItemFieldsToOrder','',NULL,'Set the mapping values for new item records created from a MARC record in a staged file. In a YAML format.','textarea'), >+('MarcOrderingAutomation','0',NULL,'Enables automatic order line creation from MARC records','YesNo'), > ('MARCOrgCode','OSt','','Define MARC Organization Code for MARC21 records - http://www.loc.gov/marc/organizations/orgshome.html','free'), > ('MARCOverlayRules','0',NULL,'Use the MARC record overlay rules system to decide what actions to take for each field when modifying records.','YesNo'), > ('MarkLostItemsAsReturned','batchmod,moredetail,cronjob,additem,pendingreserves,onpayment','claim_returned|batchmod|moredetail|cronjob|additem|pendingreserves|onpayment','Mark items as returned when flagged as lost','multiple'), >-- >2.39.3 (Apple Git-146)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 34355
:
154705
|
154706
|
154707
|
154708
|
154709
|
154710
|
157092
|
157093
|
157094
|
157095
|
157096
|
157097
|
157098
|
157099
|
157100
|
160858
|
160859
|
160860
|
160861
|
160862
|
160863
|
160864
|
160865
|
160866
|
160867
|
160868
|
160869
|
160870
|
160871
|
160872
|
160873
|
160874
|
160875
|
169896
|
169897
|
169898
|
169899
|
169900
|
169901
|
169902
|
169903
|
169904
|
170395
|
170401
|
170402
|
170403
|
170404
|
170405
|
170406
|
170407
|
170408
|
170409
|
173054
|
173055
|
173056
|
173057
|
173058
|
173059
|
173060
|
173061
|
173062
|
173063
|
173064
|
173065
|
173066
|
173709
|
173805
|
173806
|
173809
|
173824
|
173825
|
173993
|
173994
|
173995
|
173996
|
173997
|
173998
|
173999
|
174000
|
174001
|
174002
|
174003
|
174004
|
174005
|
174006
|
174007
|
174008
|
174009
|
174010
| 174362 |
174363
|
174364
|
174365
|
174366
|
174367
|
174368
|
174369
|
174370
|
174371
|
174372
|
174373
|
174374
|
174375
|
174376
|
174377
|
174378
|
174379
|
174380
|
174382
|
174383