Bugzilla – Attachment 96199 Details for
Bug 21674
Data integrity not enforced for library groups
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21674: DB changes
Bug-21674-DB-changes.patch (text/plain), 1.84 KB, created by
Jonathan Druart
on 2019-12-11 11:53:49 UTC
(
hide
)
Description:
Bug 21674: DB changes
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2019-12-11 11:53:49 UTC
Size:
1.84 KB
patch
obsolete
>From 24e11b301cebf44f4741fd773a0e40baeb36f4c7 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 11 Dec 2019 12:51:14 +0100 >Subject: [PATCH] Bug 21674: DB changes > >--- > installer/data/mysql/atomicupdate/bug_21674.perl | 12 ++++++++++++ > installer/data/mysql/kohastructure.sql | 3 ++- > 2 files changed, 14 insertions(+), 1 deletion(-) > create mode 100644 installer/data/mysql/atomicupdate/bug_21674.perl > >diff --git a/installer/data/mysql/atomicupdate/bug_21674.perl b/installer/data/mysql/atomicupdate/bug_21674.perl >new file mode 100644 >index 0000000000..3bcf5f9f76 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_21674.perl >@@ -0,0 +1,12 @@ >+$DBversion = 'XXX'; # will be replaced by the RM >+if( CheckVersion( $DBversion ) ) { >+ if( !index_exists( 'library_groups', 'library_groups_uniq_2' ) ) { >+ $dbh->do(q| >+ ALTER TABLE library_groups >+ ADD UNIQUE KEY library_groups_uniq_2 (parent_id, branchcode) >+ |); >+ } >+ >+ SetVersion( $DBversion ); >+ print "Upgrade to $DBversion done (Bug 21674 - Add unique key (parent_id, branchcode) to library_group)\n"; >+} >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 67495ab962..791c95a781 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -4280,7 +4280,8 @@ CREATE TABLE library_groups ( > PRIMARY KEY id ( id ), > FOREIGN KEY (parent_id) REFERENCES library_groups(id) ON UPDATE CASCADE ON DELETE CASCADE, > FOREIGN KEY (branchcode) REFERENCES branches(branchcode) ON UPDATE CASCADE ON DELETE CASCADE, >- UNIQUE KEY title ( title ) >+ UNIQUE KEY title ( title ), >+ UNIQUE KEY library_groups_uniq_2 ( parent_id, branchcode ) > ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; > > -- >-- >2.11.0
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 21674
:
96199
|
96200
|
97658
|
97667
|
97811
|
97837
|
97838
|
97839
|
98170
|
98171
|
98172
|
98224