Bugzilla – Attachment 89550 Details for
Bug 22887
authorised_values is missing a unique constraint on category + authorised_value
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22887: Add unique constraint to authorised_values
Bug-22887-Add-unique-constraint-to-authorisedvalue.patch (text/plain), 1.81 KB, created by
Martin Renvoize (ashimema)
on 2019-05-10 14:32:42 UTC
(
hide
)
Description:
Bug 22887: Add unique constraint to authorised_values
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2019-05-10 14:32:42 UTC
Size:
1.81 KB
patch
obsolete
>From b2bf49af39d4678484f8da2b22b643bfcd965b9c Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Fri, 10 May 2019 15:32:03 +0100 >Subject: [PATCH] Bug 22887: Add unique constraint to authorised_values > >--- > installer/data/mysql/atomicupdate/bug_22887.perl | 8 ++++++++ > installer/data/mysql/kohastructure.sql | 1 + > 2 files changed, 9 insertions(+) > create mode 100644 installer/data/mysql/atomicupdate/bug_22887.perl > >diff --git a/installer/data/mysql/atomicupdate/bug_22887.perl b/installer/data/mysql/atomicupdate/bug_22887.perl >new file mode 100644 >index 0000000000..5744d84756 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_22887.perl >@@ -0,0 +1,8 @@ >+$DBversion = 'XXX'; # will be replaced by the RM >+if( CheckVersion( $DBversion ) ) { >+ $dbh->do( q{ALTER TABLE `authorised_values` ADD CONSTRAINT `category_code` UNIQUE (category,authorised_value)} ); >+ >+ # Always end with this (adjust the bug info) >+ SetVersion( $DBversion ); >+ print "Upgrade to $DBversion done (Bug 22887 - Add unique constraint to authorised_values)\n"; >+} >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 77224bcac3..99c393f674 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -119,6 +119,7 @@ CREATE TABLE `authorised_values` ( -- stores values for authorized values catego > KEY `name` (`category`), > KEY `lib` (`lib` (191)), > KEY `auth_value_idx` (`authorised_value`), >+ CONSTRAINT `category_code` UNIQUE (`category`,`authorised_value`), > CONSTRAINT `authorised_values_authorised_values_category` FOREIGN KEY (`category`) REFERENCES `authorised_value_categories` (`category_name`) ON DELETE CASCADE ON UPDATE CASCADE > ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; > >-- >2.20.1
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 22887
:
89550
|
101790
|
101791
|
101792
|
101793
|
101889
|
101890
|
101891
|
101892
|
102409
|
102410
|
102411
|
102412
|
102511
|
102876
|
102877
|
102878
|
102879
|
102880
|
102898
|
102939
|
102999
|
103000