Bugzilla – Attachment 9539 Details for
Bug 7792
redefine the field branchcode as PRIMARY KEY of branches
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7792:redefine the field branchcode as PRIMARY KEY of branches
Bug-7792redefine-the-field-branchcode-as-PRIMARY-K.patch (text/plain), 1.81 KB, created by
Jared Camins-Esakov
on 2012-05-13 15:26:11 UTC
(
hide
)
Description:
Bug 7792:redefine the field branchcode as PRIMARY KEY of branches
Filename:
MIME Type:
Creator:
Jared Camins-Esakov
Created:
2012-05-13 15:26:11 UTC
Size:
1.81 KB
patch
obsolete
>From 8836b56bd94ab06892e88908f2483a580b1bfa9b Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?St=C3=A9phane=20Delaune?= <stephane.delaune@biblibre.com> >Date: Thu, 22 Mar 2012 11:34:35 +0100 >Subject: [PATCH] Bug 7792:redefine the field branchcode as PRIMARY KEY of branches >Content-Type: text/plain; charset="UTF-8" > >Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com> >--- > installer/data/mysql/kohastructure.sql | 2 +- > installer/data/mysql/updatedatabase.pl | 7 +++++++ > 2 files changed, 8 insertions(+), 1 deletions(-) > >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 9a94e0f..17c05f2 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -365,7 +365,7 @@ CREATE TABLE `branches` ( -- information about your libraries or branches are st > `branchprinter` varchar(100) default NULL, -- unused in Koha > `branchnotes` mediumtext, -- notes related to your library or branch > opac_info text, -- HTML that displays in OPAC >- UNIQUE KEY `branchcode` (`branchcode`) >+ PRIMARY KEY (`branchcode`) > ) ENGINE=InnoDB DEFAULT CHARSET=utf8; > > -- >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 035e1e6..293449c 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -5239,6 +5239,13 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { > SetVersion($DBversion); > } > >+$DBversion = "XXX"; >+if (C4::Context->preference("Version") < TransformToNum($DBversion)) { >+ $dbh->do("ALTER TABLE branches ADD PRIMARY KEY (branchcode);"); >+ print "Upgrade to $DBversion done (redefine the field branchcode as PRIMARY KEY of branches)\n"; >+ SetVersion ($DBversion); >+} >+ > =head1 FUNCTIONS > > =head2 TableExists($table) >-- >1.7.2.5
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 7792
:
8485
| 9539