Bugzilla – Attachment 160576 Details for
Bug 35717
Link suggestions to orders by adding ordernumber to suggestions table
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35717: DB changes
Bug-35717-DB-changes.patch (text/plain), 3.56 KB, created by
Nick Clemens (kidclamp)
on 2024-01-05 18:57:01 UTC
(
hide
)
Description:
Bug 35717: DB changes
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2024-01-05 18:57:01 UTC
Size:
3.56 KB
patch
obsolete
>From f93b48fb4c32920a62bf8812060bbc150a003396 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 10 May 2023 14:50:14 +0200 >Subject: [PATCH] Bug 35717: DB changes > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > installer/data/mysql/atomicupdate/bug_28844.pl | 18 ++++++++++++++++++ > installer/data/mysql/kohastructure.sql | 4 +++- > 2 files changed, 21 insertions(+), 1 deletion(-) > create mode 100755 installer/data/mysql/atomicupdate/bug_28844.pl > >diff --git a/installer/data/mysql/atomicupdate/bug_28844.pl b/installer/data/mysql/atomicupdate/bug_28844.pl >new file mode 100755 >index 00000000000..a11b3f154be >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_28844.pl >@@ -0,0 +1,18 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => "28844", >+ description => "Link orders and suggestions", >+ up => sub { >+ my ($args) = @_; >+ my ($dbh, $out) = @$args{qw(dbh out)}; >+ unless ( column_exists('suggestions', 'ordernumber') ) { >+ $dbh->do(q{ >+ ALTER TABLE suggestions >+ ADD COLUMN `ordernumber` int(10) DEFAULT NULL COMMENT 'links suggestion to an acquisitions order (aqorders.ordernumber)' AFTER biblionumber, >+ ADD CONSTRAINT `suggestions_ordernumber` FOREIGN KEY (`ordernumber`) REFERENCES `aqorders` (`ordernumber`) ON DELETE SET NULL ON UPDATE CASCADE >+ }); >+ say $out "Added column 'suggestions.ordernumber'"; >+ } >+ }, >+}; >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 16310f0f449..e9758afed11 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -6118,6 +6118,7 @@ CREATE TABLE `suggestions` ( > `place` varchar(255) DEFAULT NULL COMMENT 'publication place of the suggested item', > `isbn` varchar(30) DEFAULT NULL COMMENT 'isbn of the suggested item', > `biblionumber` int(11) DEFAULT NULL COMMENT 'foreign key linking the suggestion to the biblio table after the suggestion has been ordered', >+ `ordernumber` int(10) DEFAULT NULL COMMENT 'foreign key linking the suggestion to the acquisitions order after the suggestion has been ordered', > `reason` mediumtext DEFAULT NULL COMMENT 'reason for accepting or rejecting the suggestion', > `patronreason` mediumtext DEFAULT NULL COMMENT 'reason for making the suggestion', > `budgetid` int(11) DEFAULT NULL COMMENT 'foreign key linking the suggested budget to the aqbudgets table', >@@ -6145,7 +6146,8 @@ CREATE TABLE `suggestions` ( > CONSTRAINT `suggestions_ibfk_lastmodificationby` FOREIGN KEY (`lastmodificationby`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE, > CONSTRAINT `suggestions_ibfk_managedby` FOREIGN KEY (`managedby`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE, > CONSTRAINT `suggestions_ibfk_rejectedby` FOREIGN KEY (`rejectedby`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE, >- CONSTRAINT `suggestions_ibfk_suggestedby` FOREIGN KEY (`suggestedby`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE >+ CONSTRAINT `suggestions_ibfk_suggestedby` FOREIGN KEY (`suggestedby`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE, >+ CONSTRAINT `suggestions_ordernumber` FOREIGN KEY (`ordernumber`) REFERENCES `aqorders` (`ordernumber`) ON DELETE SET NULL ON UPDATE CASCADE > ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; > /*!40101 SET character_set_client = @saved_cs_client */; > >-- >2.30.2
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 35717
:
160576
|
160577
|
160578
|
160579
|
160580
|
160581
|
160582
|
160583
|
164834
|
164835
|
164836
|
164837
|
164838
|
164839
|
164840
|
172871
|
172872
|
172873
|
172874
|
172875
|
172876
|
172877
|
172878
|
172899
|
172900
|
172901