Bugzilla – Attachment 43720 Details for
Bug 14246
Add borrowernumber to koha_news
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14246: Add borrowernumber, altered SQL
Bug-14246-Add-borrowernumber-altered-SQL.patch (text/plain), 2.76 KB, created by
Mark Tompsett
on 2015-10-21 23:59:44 UTC
(
hide
)
Description:
Bug 14246: Add borrowernumber, altered SQL
Filename:
MIME Type:
Creator:
Mark Tompsett
Created:
2015-10-21 23:59:44 UTC
Size:
2.76 KB
patch
obsolete
>From 4882447cef5de1f74b8fd0d35937b9ffca96a420 Mon Sep 17 00:00:00 2001 >From: Martin Persson <xarragon@gmail.com> >Date: Wed, 27 May 2015 07:36:33 +0200 >Subject: [PATCH] Bug 14246: Add borrowernumber, altered SQL > >As suggested by kind reviewers, an AFTER statement was added to the atomic >upgrade script to ensure that the final field order is consistent is both >fresh and upgraded databases. > >Also: >* UPDATE action changed to CASCADE to improve robustness. > >Test plan: >* Apply first patch in this set. >* Apply this patch. >* Perform a database upgrade. >* Use mysql client to inspect field order. > It should be identical to the kohastructure.sql order. > >Sponsored-by: Halland County Library > >Signed-off-by: Nick Clemens <nick@quecheelibrary.org> > >Signed-off-by: Mark Tompsett <mtompset@hotmail.com> >--- > installer/data/mysql/atomicupdate/bug_14246-add_news_author.sql | 4 ++-- > installer/data/mysql/kohastructure.sql | 2 +- > 2 files changed, 3 insertions(+), 3 deletions(-) > >diff --git a/installer/data/mysql/atomicupdate/bug_14246-add_news_author.sql b/installer/data/mysql/atomicupdate/bug_14246-add_news_author.sql >index 1319d37..0a9362a 100644 >--- a/installer/data/mysql/atomicupdate/bug_14246-add_news_author.sql >+++ b/installer/data/mysql/atomicupdate/bug_14246-add_news_author.sql >@@ -1,2 +1,2 @@ >-ALTER TABLE `opac_news` ADD `borrowernumber` INT(11) default NULL; >-ALTER TABLE `opac_news` ADD CONSTRAINT `borrowernumber_fk` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers`(`borrowernumber`) ON DELETE SET NULL ON UPDATE SET NULL; >+ALTER TABLE `opac_news` ADD `borrowernumber` int(11) AFTER `number` default NULL; >+ALTER TABLE `opac_news` ADD CONSTRAINT `borrowernumber_fk` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers`(`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE; >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 2e093f6..c77307c 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -1687,7 +1687,7 @@ CREATE TABLE `opac_news` ( -- data from the news tool > `number` int(11) default NULL, -- the order in which this article appears in that specific location > `borrowernumber` int(11) default NULL, -- The user who created the news article > PRIMARY KEY (`idnew`), >- CONSTRAINT `borrowernumber_fk` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE SET NULL, >+ CONSTRAINT `borrowernumber_fk` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE, > CONSTRAINT opac_news_branchcode_ibfk FOREIGN KEY (branchcode) REFERENCES branches (branchcode) > ON DELETE CASCADE ON UPDATE CASCADE > ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; >-- >2.1.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 14246
:
39361
|
39413
|
39417
|
39439
|
39521
|
39745
|
39747
|
40125
|
43714
|
43715
|
43716
|
43717
|
43718
|
43719
|
43720
|
43721
|
43722
|
43723
|
43909
|
43910
|
43911
|
43912
|
43913