Bugzilla – Attachment 60955 Details for
Bug 18231
Add the missing id-column to koha.issuingrules-table for DBIC fixtures
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18231 - Add the missing id-column to koha.issuingrules-table for DBIC fixtures
Bug-18231---Add-the-missing-id-column-to-kohaissui.patch (text/plain), 4.18 KB, created by
Olli-Antti Kivilahti
on 2017-03-09 14:28:35 UTC
(
hide
)
Description:
Bug 18231 - Add the missing id-column to koha.issuingrules-table for DBIC fixtures
Filename:
MIME Type:
Creator:
Olli-Antti Kivilahti
Created:
2017-03-09 14:28:35 UTC
Size:
4.18 KB
patch
obsolete
>From 138db8eaf67bcd55579e3ba5dfdb66e46b78e6ab Mon Sep 17 00:00:00 2001 >From: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> >Date: Wed, 8 Mar 2017 17:35:44 +0200 >Subject: [PATCH] Bug 18231 - Add the missing id-column to > koha.issuingrules-table for DBIC fixtures > >Many DBIx-stuffs depend on last_insert_id >--- > Koha/Schema/Result/Issuingrule.pm | 31 +++++++++++++++++++--- > .../Bug-18231-id_to_ussingrules_table.sql | 3 +++ > installer/data/mysql/kohastructure.sql | 4 ++- > 3 files changed, 34 insertions(+), 4 deletions(-) > create mode 100644 installer/data/mysql/atomicupdate/Bug-18231-id_to_ussingrules_table.sql > >diff --git a/Koha/Schema/Result/Issuingrule.pm b/Koha/Schema/Result/Issuingrule.pm >index 62f35f2..b1fb2f1 100644 >--- a/Koha/Schema/Result/Issuingrule.pm >+++ b/Koha/Schema/Result/Issuingrule.pm >@@ -23,6 +23,12 @@ __PACKAGE__->table("issuingrules"); > > =head1 ACCESSORS > >+=head2 issuingrules_id >+ >+ data_type: 'integer' >+ is_auto_increment: 1 >+ is_nullable: 0 >+ > =head2 categorycode > > data_type: 'varchar' >@@ -212,6 +218,8 @@ __PACKAGE__->table("issuingrules"); > =cut > > __PACKAGE__->add_columns( >+ "issuingrules_id", >+ { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, > "categorycode", > { data_type => "varchar", default_value => "", is_nullable => 0, size => 10 }, > "itemtype", >@@ -292,6 +300,20 @@ __PACKAGE__->add_columns( > > =over 4 > >+=item * L</issuingrules_id> >+ >+=back >+ >+=cut >+ >+__PACKAGE__->set_primary_key("issuingrules_id"); >+ >+=head1 UNIQUE CONSTRAINTS >+ >+=head2 C<issuingrules_selects> >+ >+=over 4 >+ > =item * L</branchcode> > > =item * L</categorycode> >@@ -302,11 +324,14 @@ __PACKAGE__->add_columns( > > =cut > >-__PACKAGE__->set_primary_key("branchcode", "categorycode", "itemtype"); >+__PACKAGE__->add_unique_constraint( >+ "issuingrules_selects", >+ ["branchcode", "categorycode", "itemtype"], >+); > > >-# Created by DBIx::Class::Schema::Loader v0.07042 @ 2016-11-02 10:33:37 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:t9AhZLbm4SE7mx25LAyhGA >+# Created by DBIx::Class::Schema::Loader v0.07045 @ 2017-03-08 15:49:48 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:714V5KtlVyeDUidAdc2m/g > > > # You can replace this text with custom code or comments, and it will be preserved on regeneration >diff --git a/installer/data/mysql/atomicupdate/Bug-18231-id_to_ussingrules_table.sql b/installer/data/mysql/atomicupdate/Bug-18231-id_to_ussingrules_table.sql >new file mode 100644 >index 0000000..a7cd8a7 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/Bug-18231-id_to_ussingrules_table.sql >@@ -0,0 +1,3 @@ >+ALTER TABLE `issuingrules` DROP PRIMARY KEY; >+ALTER TABLE `issuingrules` ADD `issuingrules_id` INT( 11 ) NOT NULL auto_increment PRIMARY KEY FIRST; >+ALTER TABLE `issuingrules` ADD CONSTRAINT UNIQUE `issuingrules_id` (`branchcode`,`categorycode`,`itemtype`); >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 7ca59ee..ca98ee9 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -848,6 +848,7 @@ CREATE TABLE `import_items` ( > > DROP TABLE IF EXISTS `issuingrules`; > CREATE TABLE `issuingrules` ( -- circulation and fine rules >+ `issuingrules_id` int(11) NOT NULL auto_increment, > `categorycode` varchar(10) NOT NULL default '', -- patron category this rule is for (categories.categorycode) > `itemtype` varchar(10) NOT NULL default '', -- item type this rule is for (itemtypes.itemtype) > `restrictedtype` tinyint(1) default NULL, -- not used? always NULL >@@ -880,7 +881,8 @@ CREATE TABLE `issuingrules` ( -- circulation and fine rules > onshelfholds tinyint(1) NOT NULL default 0, -- allow holds for items that are on shelf > opacitemholds char(1) NOT NULL default 'N', -- allow opac users to place specific items on hold > article_requests enum('no','yes','bib_only','item_only') NOT NULL DEFAULT 'no', -- allow article requests to be placed, >- PRIMARY KEY (`branchcode`,`categorycode`,`itemtype`), >+ PRIMARY KEY (`issuingrules_id`), >+ UNIQUE KEY `issuingrules_selects` (`branchcode`,`categorycode`,`itemtype`), > KEY `categorycode` (`categorycode`), > KEY `itemtype` (`itemtype`) > ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; >-- >2.7.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 18231
:
60921
|
60955
|
60964
|
61102
|
61218
|
61219
|
64966
|
64967
|
64968
|
66969
|
66970
|
66971