Bugzilla – Attachment 89736 Details for
Bug 22899
Cannot view course details
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22899: Database update
Bug-22899-Database-update.patch (text/plain), 2.17 KB, created by
Martin Renvoize (ashimema)
on 2019-05-14 12:24:53 UTC
(
hide
)
Description:
Bug 22899: Database update
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2019-05-14 12:24:53 UTC
Size:
2.17 KB
patch
obsolete
>From 31b0c918d2055a958f8325c1bfa8ca981dd1dd6f Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Mon, 13 May 2019 20:08:06 +0000 >Subject: [PATCH] Bug 22899: Database update > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > ...22899_add_items_constraint_to_tmpholdsqueue.perl | 13 +++++++++++++ > installer/data/mysql/kohastructure.sql | 4 +++- > 2 files changed, 16 insertions(+), 1 deletion(-) > create mode 100644 installer/data/mysql/atomicupdate/bug_22899_add_items_constraint_to_tmpholdsqueue.perl > >diff --git a/installer/data/mysql/atomicupdate/bug_22899_add_items_constraint_to_tmpholdsqueue.perl b/installer/data/mysql/atomicupdate/bug_22899_add_items_constraint_to_tmpholdsqueue.perl >new file mode 100644 >index 0000000000..1e14394955 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_22899_add_items_constraint_to_tmpholdsqueue.perl >@@ -0,0 +1,13 @@ >+$DBversion = 'XXX'; # will be replaced by the RM >+if( CheckVersion( $DBversion ) ) { >+ # you can use $dbh here like: >+ unless ( foreign_key_exists( 'tmp_holdsqueue', 'tmp_holdsqueue_ibfk_1' ) ) { >+ $dbh->do(q{ >+ ALTER TABLE tmp_holdsqueue >+ ADD CONSTRAINT `tmp_holdsqueue_ibfk_1` FOREIGN KEY (`itemnumber`) >+ REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE >+ }); >+ } >+ SetVersion( $DBversion ); >+ print "Upgrade to $DBversion done (Bug XXXXX - Add items constraint to tmp_holdsqueue)\n"; >+} >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index d5864d18d5..da3ff83f37 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -2458,7 +2458,9 @@ CREATE TABLE `tmp_holdsqueue` ( > `holdingbranch` varchar(10) default NULL, > `pickbranch` varchar(10) default NULL, > `notes` MEDIUMTEXT, >- `item_level_request` tinyint(4) NOT NULL default 0 >+ `item_level_request` tinyint(4) NOT NULL default 0, >+ CONSTRAINT `tmp_holdsqueue_ibfk_1` FOREIGN KEY (`itemnumber`) >+ REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE > ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; > > -- >-- >2.20.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 22899
:
89706
|
89707
|
89708
|
89709
|
89725
| 89736 |
89737
|
89738
|
89739
|
89740