Bugzilla – Attachment 73394 Details for
Bug 19520
Show more information about rotating collections
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19520: Update database
Bug-19520-Update-database.patch (text/plain), 2.92 KB, created by
Josef Moravec
on 2018-03-28 15:35:23 UTC
(
hide
)
Description:
Bug 19520: Update database
Filename:
MIME Type:
Creator:
Josef Moravec
Created:
2018-03-28 15:35:23 UTC
Size:
2.92 KB
patch
obsolete
>From 75f10aac4672eea9b124cddb673d3ae24c8fa276 Mon Sep 17 00:00:00 2001 >From: Josef Moravec <josef.moravec@gmail.com> >Date: Sun, 12 Nov 2017 10:49:40 +0000 >Subject: [PATCH] Bug 19520: Update database > >--- > ...dd_more_information_to_rotating_collections.perl | 21 +++++++++++++++++++++ > installer/data/mysql/kohastructure.sql | 6 ++++++ > 2 files changed, 27 insertions(+) > create mode 100644 installer/data/mysql/atomicupdate/Bug19520_Add_more_information_to_rotating_collections.perl > >diff --git a/installer/data/mysql/atomicupdate/Bug19520_Add_more_information_to_rotating_collections.perl b/installer/data/mysql/atomicupdate/Bug19520_Add_more_information_to_rotating_collections.perl >new file mode 100644 >index 0000000..a344e98 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/Bug19520_Add_more_information_to_rotating_collections.perl >@@ -0,0 +1,21 @@ >+$DBversion = 'XXX'; # will be replaced by the RM >+if( CheckVersion( $DBversion ) ) { >+ >+ if( !column_exists( 'collections', 'createdBy' ) ) { >+ $dbh->do( "ALTER TABLE collections ADD COLUMN createdBy int(11) default NULL AFTER colBranchcode" ); >+ } >+ >+ $dbh->do( "ALTER TABLE collections ADD CONSTRAINT `collections_ibfk_2` FOREIGN KEY (`createdBy`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE"); >+ >+ if( !column_exists( 'collections', 'createdOn' ) ) { >+ $dbh->do( "ALTER TABLE collections ADD COLUMN createdOn datetime default NULL AFTER createdBy" ); >+ } >+ >+ if( !column_exists( 'collections', 'lastTransferredOn' ) ) { >+ $dbh->do( "ALTER TABLE collections ADD COLUMN lastTransferredOn datetime default NULL AFTER createdOn" ); >+ } >+ >+ # Always end with this (adjust the bug info) >+ SetVersion( $DBversion ); >+ print "Upgrade to $DBversion done (Bug 19520 - Add additional information to rotating collections)\n"; >+} >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 496f791..5f3b40b 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -318,6 +318,9 @@ CREATE TABLE collections ( > colTitle varchar(100) NOT NULL DEFAULT '', > colDesc MEDIUMTEXT NOT NULL, > colBranchcode varchar(10) DEFAULT NULL, -- 'branchcode for branch where item should be held.' >+ createdBy int(11) default NULL, >+ createdOn datetime default NULL, >+ lastTransferredOn datetime default NULL, > PRIMARY KEY (colId) > ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; > >@@ -327,6 +330,9 @@ CREATE TABLE collections ( > ALTER TABLE `collections` > ADD CONSTRAINT `collections_ibfk_1` FOREIGN KEY (`colBranchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE; > >+ALTER TABLE `collections` >+ ADD CONSTRAINT `collections_ibfk_2` FOREIGN KEY (`createdBy`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE; >+ > -- > -- Table structure for table `branch_borrower_circ_rules` > -- >-- >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 19520
:
72819
|
72820
|
72821
|
72822
|
73260
|
73261
|
73262
|
73263
| 73394 |
73395
|
73396
|
73397