Bugzilla – Attachment 18431 Details for
Bug 10363
Move authorised value related code into its own package
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10363: DB Changes: Adds a unique key for the authorised values table.
Bug-10363-DB-Changes-Adds-a-unique-key-for-the-aut.patch (text/plain), 1.72 KB, created by
Jonathan Druart
on 2013-05-28 14:11:27 UTC
(
hide
)
Description:
Bug 10363: DB Changes: Adds a unique key for the authorised values table.
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2013-05-28 14:11:27 UTC
Size:
1.72 KB
patch
obsolete
>From ebb01a8222228e15d7b2bcedc86a8f8540d42acf Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Tue, 28 May 2013 16:09:41 +0200 >Subject: [PATCH] Bug 10363: DB Changes: Adds a unique key for the authorised > values table. > >--- > installer/data/mysql/kohastructure.sql | 1 + > installer/data/mysql/updatedatabase.pl | 12 ++++++++++++ > 2 files changed, 13 insertions(+) > >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index ca2f2b2..9c5ec04 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -103,6 +103,7 @@ CREATE TABLE `authorised_values` ( -- stores values for authorized values catego > `lib_opac` varchar(200) default NULL, -- authorized value description as printed in the OPAC > `imageurl` varchar(200) default NULL, -- authorized value URL > PRIMARY KEY (`id`), >+ UNIQUE KEY `av_uniq` (`category`,`authorised_value`), > KEY `name` (`category`), > KEY `lib` (`lib`), > KEY `auth_value_idx` (`authorised_value`) >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index f3a90d8..5df456e 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -6984,6 +6984,18 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( > } > > >+ >+ >+ >+$DBversion = "3.13.00.XXX"; >+if ( CheckVersion($DBversion) ) { >+ $dbh->do(q{ >+ ALTER TABLE authorised_values ADD UNIQUE KEY av_uniq(category, authorised_value); >+ }); >+ print "Upgrade to $DBversion done (Bug XXXXX: Add unique key on the authorised_values table)\n"; >+ SetVersion($DBversion); >+} >+ > =head1 FUNCTIONS > > =head2 TableExists($table) >-- >1.7.10.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 10363
:
18430
|
18431
|
18432
|
18751
|
18752
|
18753
|
20729
|
21833
|
21834
|
21835
|
21836
|
25284
|
25285
|
25286
|
25287
|
30583
|
30584
|
30585
|
30710
|
30711
|
30712
|
31565
|
32632
|
32633
|
32634
|
33416
|
33417
|
33422
|
33423
|
33860
|
33861
|
33862
|
33889
|
33949
|
35838
|
35839
|
35840
|
35841
|
41290
|
41291
|
41292
|
41293
|
41294
|
41302
|
41343
|
41344
|
41345
|
43112
|
43113
|
43114
|
43550
|
43551
|
43552
|
43553
|
43554
|
43555
|
43556
|
43557
|
43558
|
43559
|
43696
|
43827