Bugzilla – Attachment 172871 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.60 KB, created by
Tomás Cohen Arazi (tcohen)
on 2024-10-17 13:48:41 UTC
(
hide
)
Description:
Bug 35717: DB changes
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2024-10-17 13:48:41 UTC
Size:
3.60 KB
patch
obsolete
>From c11b55c673561eba04e66da918cc0aada493927a 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> >--- > .../data/mysql/atomicupdate/bug_35717.pl | 20 +++++++++++++++++++ > installer/data/mysql/kohastructure.sql | 4 +++- > 2 files changed, 23 insertions(+), 1 deletion(-) > create mode 100755 installer/data/mysql/atomicupdate/bug_35717.pl > >diff --git a/installer/data/mysql/atomicupdate/bug_35717.pl b/installer/data/mysql/atomicupdate/bug_35717.pl >new file mode 100755 >index 00000000000..f56ad9b72e5 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_35717.pl >@@ -0,0 +1,20 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => "35717", >+ 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 31f0828a24e..7b40543c751 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -6175,6 +6175,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', >@@ -6202,7 +6203,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.47.0
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