Bugzilla – Attachment 9538 Details for
Bug 7794
redefine the field id as PRIMARY KEY of sessions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7794:redefine the field id as PRIMARY KEY of sessions
Bug-7794redefine-the-field-id-as-PRIMARY-KEY-of-se.patch (text/plain), 1.61 KB, created by
Jared Camins-Esakov
on 2012-05-13 15:17:54 UTC
(
hide
)
Description:
Bug 7794:redefine the field id as PRIMARY KEY of sessions
Filename:
MIME Type:
Creator:
Jared Camins-Esakov
Created:
2012-05-13 15:17:54 UTC
Size:
1.61 KB
patch
obsolete
>From c29362093e9a550b936f27d446158947961088e8 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:48:36 +0100 >Subject: [PATCH] Bug 7794:redefine the field id as PRIMARY KEY of sessions >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..75fe450 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -1780,7 +1780,7 @@ DROP TABLE IF EXISTS sessions; > CREATE TABLE sessions ( > `id` varchar(32) NOT NULL, > `a_session` text NOT NULL, >- UNIQUE KEY id (id) >+ PRIMARY KEY (`id`) > ) ENGINE=InnoDB DEFAULT CHARSET=utf8; > > -- >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 035e1e6..b89eff2 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 sessions ADD PRIMARY KEY (id);"); >+ print "Upgrade to $DBversion done (redefine the field id as PRIMARY KEY of sessions)\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 7794
:
8490
| 9538