Bugzilla – Attachment 3506 Details for
Bug 5860
Adding duplicate stocknumber will fail silently
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
0001-Bug-5860-Adding-duplicate-stocknumber-fails-silently.patch (text/plain), 1.98 KB, created by
Katrin Fischer
on 2011-03-29 20:54:26 UTC
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2011-03-29 20:54:26 UTC
Size:
1.98 KB
patch
obsolete
>From b84f35083f60bf44f6572d412da9dabab66dc18b Mon Sep 17 00:00:00 2001 >From: Katrin Fischer <Katrin.Fischer.83@web.de> >Date: Tue, 29 Mar 2011 22:50:15 +0200 >Subject: [PATCH] Bug 5860: Adding duplicate stocknumber fails silently >Content-Type: text/plain; charset="utf-8" > >When adding a duplicate stocknumber the duplicate was not saved to the database. >This happened, because the field stocknumber in table items was declared to be unique. >Discussion on bug suggests to lift this restriction. >--- > installer/data/mysql/kohastructure.sql | 2 +- > installer/data/mysql/updatedatabase.pl | 8 ++++++++ > 2 files changed, 9 insertions(+), 1 deletions(-) > >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index a62e07c..de27862 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -1020,7 +1020,7 @@ CREATE TABLE `items` ( > `stocknumber` varchar(32) default NULL, > PRIMARY KEY (`itemnumber`), > UNIQUE KEY `itembarcodeidx` (`barcode`), >- UNIQUE KEY `itemstocknumberidx` (`stocknumber`), >+ KEY `itemstocknumberidx` (`stocknumber`), > KEY `itembinoidx` (`biblioitemnumber`), > KEY `itembibnoidx` (`biblionumber`), > KEY `homebranch` (`homebranch`), >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 23b5d67..8e9216c 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -4134,6 +4134,14 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { > SetVersion ($DBversion); > } > >+$DBversion = '3.03.00.XXX'; >+if (C4::Context->preference("Version") < TransformToNum($DBversion)) { >+ $dbh->do("ALTER TABLE `items` DROP INDEX `itemstocknumberidx`;"); >+ $dbh->do("ALTER TABLE items ADD INDEX itemstocknumberidx (stocknumber);"); >+ print "Upgrade to $DBversion done (Change items.stocknumber to be not unique)\n"; >+ SetVersion ($DBversion); >+} >+ > =head1 FUNCTIONS > > =head2 DropAllForeignKeys($table) >-- >1.7.1 >
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 5860
:
3506
|
3615
|
4092
|
4103
|
4121
|
4122
|
4123
|
4141
|
4143
|
4144