Bugzilla – Attachment 8490 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]
proposed patch
0001-Bug-7794-redefine-the-field-id-as-PRIMARY-KEY-of-ses.patch (text/plain), 1.51 KB, created by
Stéphane Delaune
on 2012-03-22 10:49:12 UTC
(
hide
)
Description:
proposed patch
Filename:
MIME Type:
Creator:
Stéphane Delaune
Created:
2012-03-22 10:49:12 UTC
Size:
1.51 KB
patch
obsolete
>From aa2c2a574f8d645674fced20fdae1a28137afb0e 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 > >--- > installer/data/mysql/kohastructure.sql | 1 + > installer/data/mysql/updatedatabase.pl | 7 +++++++ > 2 files changed, 8 insertions(+), 0 deletions(-) > >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index f5d8a24..751aafd 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -1766,6 +1766,7 @@ DROP TABLE IF EXISTS sessions; > CREATE TABLE sessions ( > `id` varchar(32) NOT NULL, > `a_session` text NOT NULL, >+ PRIMARY KEY (`id`), > UNIQUE KEY id (id) > ) ENGINE=InnoDB DEFAULT CHARSET=utf8; > >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 32099d8..8c18a0d 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -4994,6 +4994,13 @@ if ( C4::Context->preference("Version") lt 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 DropAllForeignKeys($table) >-- >1.7.5.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 7794
:
8490
|
9538