Bugzilla – Attachment 56643 Details for
Bug 14957
Write protecting MARC fields based on source of import
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14957: Database changes
Bug-14957-Database-changes.patch (text/plain), 3.56 KB, created by
Josef Moravec
on 2016-10-19 09:23:03 UTC
(
hide
)
Description:
Bug 14957: Database changes
Filename:
MIME Type:
Creator:
Josef Moravec
Created:
2016-10-19 09:23:03 UTC
Size:
3.56 KB
patch
obsolete
>From ba314adfcdbea1292c18e33ec03bbb9b518f62ff Mon Sep 17 00:00:00 2001 >From: Martin Stenberg <martin@xinxidi.net> >Date: Mon, 26 Oct 2015 18:22:35 +0100 >Subject: [PATCH] Bug 14957: Database changes > >--- > .../bug_14957-marc-permissions-syspref.sql | 3 +++ > .../atomicupdate/bug_14957-marc-permissions.sql | 31 ++++++++++++++++++++++ > 2 files changed, 34 insertions(+) > create mode 100644 installer/data/mysql/atomicupdate/bug_14957-marc-permissions-syspref.sql > create mode 100644 installer/data/mysql/atomicupdate/bug_14957-marc-permissions.sql > >diff --git a/installer/data/mysql/atomicupdate/bug_14957-marc-permissions-syspref.sql b/installer/data/mysql/atomicupdate/bug_14957-marc-permissions-syspref.sql >new file mode 100644 >index 0000000..d697fc3 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_14957-marc-permissions-syspref.sql >@@ -0,0 +1,3 @@ >+INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES ('MARCPermissions','0','','Use the MARC permissions system to decide what actions to take for each field when modifying records.','YesNo'); >+INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES ('MARCPermissionsLog','0','','Write MARC permissions rule evaluations to the system log when applying rules for MARC field modifications.','YesNo'); >+INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES ('MARCPermissionsCorrectionSimilarity','90','','New field value is considered a correction if it is similar to the old to the specified percentage.','Integer'); >diff --git a/installer/data/mysql/atomicupdate/bug_14957-marc-permissions.sql b/installer/data/mysql/atomicupdate/bug_14957-marc-permissions.sql >new file mode 100644 >index 0000000..ffbc633 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_14957-marc-permissions.sql >@@ -0,0 +1,31 @@ >+DROP TABLE IF EXISTS `marc_permissions`; >+DROP TABLE IF EXISTS `marc_permissions_modules`; >+ >+CREATE TABLE `marc_permissions_modules` ( >+ `id` int(11) NOT NULL auto_increment, >+ `name` varchar(24) NOT NULL, >+ `description` varchar(255), >+ `specificity` int(11) NOT NULL DEFAULT 0, -- higher specificity will override rules with lower specificity >+ PRIMARY KEY(`id`) >+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; >+ >+-- a couple of useful default filter modules >+-- these are used in various scripts, so don't remove them if you don't know >+-- what you're doing. >+-- New filter modules can be added here when needed >+INSERT INTO `marc_permissions_modules` VALUES(NULL, 'source', 'source from where modification request was sent', 0); >+INSERT INTO `marc_permissions_modules` VALUES(NULL, 'category', 'categorycode of user who requested modification', 1); >+INSERT INTO `marc_permissions_modules` VALUES(NULL, 'borrower', 'borrowernumber of user who requested modification', 2); >+ >+CREATE TABLE `marc_permissions` ( >+ `id` int(11) NOT NULL auto_increment, >+ `tagfield` varchar(255) NOT NULL, -- can be regexe, so need > 3 chars >+ `tagsubfield` varchar(255) DEFAULT NULL, -- can be regex, so need > 1 char >+ `module` int(11) NOT NULL, >+ `filter` varchar(255) NOT NULL, >+ `on_existing` ENUM('skip', 'overwrite', 'add', 'add_or_correct') DEFAULT NULL, >+ `on_new` ENUM('skip', 'add') DEFAULT NULL, >+ `on_removed` ENUM('skip', 'remove') DEFAULT NULL, >+ PRIMARY KEY(`id`), >+ CONSTRAINT `marc_permissions_ibfk1` FOREIGN KEY (`module`) REFERENCES `marc_permissions_modules` (`id`) ON DELETE CASCADE >+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; >-- >2.1.4
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 14957
:
44056
|
44057
|
44058
|
51723
|
51724
|
56637
|
56638
|
56643
|
56644
|
56645
|
56646
|
56647
|
56648
|
57114
|
57115
|
57116
|
57117
|
57118
|
57119
|
59811
|
59812
|
59885
|
60711
|
60824
|
60825
|
61065
|
61641
|
61736
|
64792
|
72498
|
74855
|
75118
|
76201
|
76202
|
76203
|
76204
|
76205
|
76206
|
76207
|
76208
|
76209
|
76210
|
78651
|
78652
|
78653
|
79367
|
79368
|
79369
|
79370
|
79890
|
80972
|
80973
|
80974
|
80975
|
81176
|
81177
|
81178
|
81179
|
81621
|
81699
|
81700
|
81705
|
81706
|
81707
|
81708
|
81969
|
81970
|
81971
|
82030
|
82031
|
82775
|
87709
|
87711
|
87771
|
87929
|
88205
|
88206
|
89961
|
90668
|
90669
|
90671
|
90672
|
90722
|
90723
|
90740
|
90741
|
92933
|
92934
|
92935
|
92936
|
92937
|
92938
|
92999
|
93499
|
94909
|
94911
|
99998
|
100052
|
100053
|
100054
|
100055
|
100056
|
100057
|
100058
|
100059
|
100060
|
100061
|
101510
|
109955
|
109956
|
109957
|
109958
|
109959
|
109960
|
109961
|
109962
|
109963
|
116622
|
116623
|
116624
|
116625
|
117844
|
117845
|
117849
|
117850
|
117853
|
117859
|
117964
|
117965
|
117966
|
118918
|
118919
|
118920
|
118921
|
118922
|
118923
|
118924
|
118925
|
118926
|
118927
|
118934
|
118935
|
118936
|
118937
|
118938
|
118939
|
118940
|
118941
|
118942
|
118943
|
118944
|
118945
|
118946
|
118957
|
120533
|
120534
|
120535
|
120536
|
120537
|
120538
|
120539
|
120540
|
120541
|
120542
|
120543
|
120544
|
120545
|
120546
|
120547
|
120548
|
120550
|
120553
|
120554
|
120555
|
120556
|
120557
|
120581
|
120582
|
120583
|
120584
|
120585
|
120586
|
120587
|
120588
|
120589
|
120590
|
120591
|
120592
|
120593
|
120594
|
120595
|
120596
|
120597
|
120598
|
120599
|
120600
|
120601
|
120602
|
120603
|
120604
|
120605
|
120670
|
120671
|
120705
|
125514
|
125515
|
125516
|
125517
|
125518
|
125519
|
125520
|
125521
|
125522
|
125523
|
125524
|
125525
|
125526
|
125527
|
125528
|
125529
|
125530
|
125531
|
125532
|
125533
|
125534
|
125535
|
125536
|
125537
|
125538
|
125539
|
125540
|
125632
|
125633
|
125636
|
126424
|
126425
|
126431
|
126592
|
126666
|
126667
|
126752
|
126753
|
126754
|
126755
|
126756
|
126757
|
126758
|
126759
|
126760
|
126761
|
126762
|
126763
|
126764
|
126765
|
126766
|
126767
|
126768
|
126769
|
126770
|
126771
|
126772
|
126773
|
126774
|
126775
|
126776
|
126777
|
126778
|
126779
|
126780
|
126781
|
126782
|
126783
|
126784
|
126785
|
126786
|
126950
|
126951