Bugzilla – Attachment 96977 Details for
Bug 21946
Group circulation by item type
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21946: Database updates
Bug-21946-Database-updates.patch (text/plain), 2.82 KB, created by
Nick Clemens (kidclamp)
on 2020-01-08 12:31:19 UTC
(
hide
)
Description:
Bug 21946: Database updates
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2020-01-08 12:31:19 UTC
Size:
2.82 KB
patch
obsolete
>From 89476a4bfe6d101153ed3f5c8fc6b5acf07473d2 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Wed, 13 Mar 2019 00:36:48 +0000 >Subject: [PATCH] Bug 21946: Database updates > >Signed-off-by: Liz Rea <wizzyrea@gmail.com> > >Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com> >--- > installer/data/mysql/atomicupdate/bug_21946.perl | 20 ++++++++++++++++++++ > installer/data/mysql/kohastructure.sql | 2 ++ > 2 files changed, 22 insertions(+) > create mode 100644 installer/data/mysql/atomicupdate/bug_21946.perl > >diff --git a/installer/data/mysql/atomicupdate/bug_21946.perl b/installer/data/mysql/atomicupdate/bug_21946.perl >new file mode 100644 >index 0000000000..e5bbc86387 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_21946.perl >@@ -0,0 +1,20 @@ >+$DBversion = 'XXX'; >+if( CheckVersion( $DBversion ) ) { >+ unless ( column_exists('itemtypes', 'parent_type') ) { >+ $dbh->do(q{ >+ ALTER TABLE itemtypes >+ ADD COLUMN parent_type VARCHAR(10) NULL DEFAULT NULL >+ AFTER itemtype; >+ >+ }); >+ } >+ unless ( foreign_key_exists( 'itemtypes', 'itemtypes_ibfk_1') ){ >+ $dbh->do(q{ >+ ALTER TABLE itemtypes >+ ADD CONSTRAINT itemtypes_ibfk_1 >+ FOREIGN KEY (parent_type) REFERENCES itemtypes (itemtype) >+ }); >+ } >+ SetVersion( $DBversion ); >+ print "Upgrade to $DBversion done (Bug 21946 - Add parent type to itemtypes)\n"; >+} >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index c702d405a0..ade8e7cc67 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -920,6 +920,7 @@ CREATE TABLE `items` ( -- holdings/item information > DROP TABLE IF EXISTS `itemtypes`; > CREATE TABLE `itemtypes` ( -- defines the item types > itemtype varchar(10) NOT NULL default '', -- unique key, a code associated with the item type >+ parent_type varchar(10) NULL default NULL, -- unique key, a code associated with the item type > description LONGTEXT, -- a plain text explanation of the item type > rentalcharge decimal(28,6) default NULL, -- the amount charged when this item is checked out/issued > rentalcharge_daily decimal(28,6) default NULL, -- the amount charged for each day between checkout date and due date >@@ -935,6 +936,7 @@ CREATE TABLE `itemtypes` ( -- defines the item types > hideinopac tinyint(1) NOT NULL DEFAULT 0, -- Hide the item type from the search options in OPAC > searchcategory varchar(80) default NULL, -- Group this item type with others with the same value on OPAC search options > PRIMARY KEY (`itemtype`), >+ FOREIGN KEY (parent_type) REFERENCES itemtypes(itemtype) ON UPDATE CASCADE ON DELETE CASCADE, > UNIQUE KEY `itemtype` (`itemtype`) > ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; > >-- >2.11.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 21946
:
87713
|
87714
|
87715
|
87716
|
87717
|
87718
|
87719
|
88392
|
88574
|
88575
|
88576
|
88577
|
88578
|
88579
|
88580
|
88581
|
88926
|
88927
|
88928
|
88929
|
88930
|
88931
|
88932
|
88933
|
88934
|
89167
|
89168
|
89169
|
89170
|
89171
|
89172
|
89173
|
89174
|
89175
|
89176
|
93075
|
93076
|
93077
|
93078
|
93079
|
93080
|
93081
|
93082
|
93083
|
93084
|
93086
|
93087
|
93088
|
93089
|
93090
|
93091
|
93092
|
93093
|
93094
|
93095
|
93096
|
93097
|
93098
|
93099
|
93100
|
93101
|
93102
|
93103
|
93104
|
93105
|
96977
|
96978
|
96979
|
96980
|
96981
|
96982
|
96983
|
96984
|
96985
|
96986
|
96987
|
99419
|
99420
|
99421
|
99422
|
99423
|
99424
|
107035
|
107036
|
107037
|
107038
|
107039
|
107040
|
107041
|
107278
|
107279
|
107280
|
107281
|
107282
|
107283
|
107284
|
107467
|
107489
|
107686
|
107687
|
107688
|
107689
|
107690
|
107691
|
107692
|
107693
|
107694
|
107701
|
107733