Bugzilla – Attachment 91450 Details for
Bug 15497
Limit item types by library
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15497: Add itemtypes_branches table and atomic update
Bug-15497-Add-itemtypesbranches-table-and-atomic-u.patch (text/plain), 2.47 KB, created by
Agustín Moyano
on 2019-07-10 23:01:59 UTC
(
hide
)
Description:
Bug 15497: Add itemtypes_branches table and atomic update
Filename:
MIME Type:
Creator:
Agustín Moyano
Created:
2019-07-10 23:01:59 UTC
Size:
2.47 KB
patch
obsolete
>From 3e66d802cc5f7f9676e3dd69a2cbf037c664c1a0 Mon Sep 17 00:00:00 2001 >From: Agustin Moyano <agustinmoyano@theke.io> >Date: Thu, 4 Jul 2019 01:30:17 -0300 >Subject: [PATCH] Bug 15497: Add itemtypes_branches table and atomic update > >--- > .../data/mysql/atomicupdate/bug_15497.perl | 17 +++++++++++++++++ > installer/data/mysql/kohastructure.sql | 12 ++++++++++++ > 2 files changed, 29 insertions(+) > create mode 100644 installer/data/mysql/atomicupdate/bug_15497.perl > >diff --git a/installer/data/mysql/atomicupdate/bug_15497.perl b/installer/data/mysql/atomicupdate/bug_15497.perl >new file mode 100644 >index 0000000000..cc187cd7cd >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_15497.perl >@@ -0,0 +1,17 @@ >+$DBversion = 'XXX'; # will be replaced by the RM >+if( CheckVersion( $DBversion ) ) { >+ >+ if( !TableExists( 'itemtypes_branches' ) ) { >+ $dbh->do( " >+ CREATE TABLE itemtypes_branches( -- association table between authorised_values and branches >+ itemtype VARCHAR(10) NOT NULL, >+ branchcode VARCHAR(10) NOT NULL, >+ FOREIGN KEY (itemtype) REFERENCES itemtypes(itemtype) ON DELETE CASCADE, >+ FOREIGN KEY (branchcode) REFERENCES branches(branchcode) ON DELETE CASCADE >+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; >+ "); >+ } >+ >+ SetVersion( $DBversion ); >+ print "Upgrade to $DBversion done (Bug 15497 - Add itemtypes_branches table)\n"; >+} >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 9b062d0800..58a313ad1a 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -4288,6 +4288,18 @@ shortcut_keys varchar(80) NOT NULL, > PRIMARY KEY (shortcut_name) > ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; > >+-- >+-- Table structure for table itemtypes_branches >+-- >+ >+DROP TABLE IF EXISTS itemtypes_branches; >+CREATE TABLE itemtypes_branches( -- association table between authorised_values and branches >+ itemtype VARCHAR(10) NOT NULL, >+ branchcode VARCHAR(10) NOT NULL, >+ FOREIGN KEY (itemtype) REFERENCES itemtypes(itemtype) ON DELETE CASCADE, >+ FOREIGN KEY (branchcode) REFERENCES branches(branchcode) ON DELETE CASCADE >+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; >+ > /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; > /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; > /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; >-- >2.17.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 15497
:
91377
|
91378
|
91379
|
91446
|
91450
|
91451
|
91452
|
91469
|
92725
|
92726
|
92727
|
92728
|
92732
|
92735
|
92736
|
92737
|
92738
|
92739
|
92741
|
92742
|
92743
|
92744
|
92745