View | Details | Raw Unified | Return to bug 18231
Collapse All | Expand All

(-)a/Koha/Schema/Result/Issuingrule.pm (-2 / +26 lines)
Lines 23-28 __PACKAGE__->table("issuingrules"); Link Here
23
23
24
=head1 ACCESSORS
24
=head1 ACCESSORS
25
25
26
=head2 issuingrules_id
27
28
  data_type: 'integer'
29
  is_auto_increment: 1
30
  is_nullable: 0
31
26
=head2 categorycode
32
=head2 categorycode
27
33
28
  data_type: 'varchar'
34
  data_type: 'varchar'
Lines 218-223 __PACKAGE__->table("issuingrules"); Link Here
218
=cut
224
=cut
219
225
220
__PACKAGE__->add_columns(
226
__PACKAGE__->add_columns(
227
  "issuingrules_id",
228
  { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
221
  "categorycode",
229
  "categorycode",
222
  { data_type => "varchar", default_value => "", is_nullable => 0, size => 10 },
230
  { data_type => "varchar", default_value => "", is_nullable => 0, size => 10 },
223
  "itemtype",
231
  "itemtype",
Lines 300-305 __PACKAGE__->add_columns( Link Here
300
308
301
=over 4
309
=over 4
302
310
311
=item * L</issuingrules_id>
312
313
=back
314
315
=cut
316
317
__PACKAGE__->set_primary_key("issuingrules_id");
318
319
=head1 UNIQUE CONSTRAINTS
320
321
=head2 C<issuingrules_selects>
322
323
=over 4
324
303
=item * L</branchcode>
325
=item * L</branchcode>
304
326
305
=item * L</categorycode>
327
=item * L</categorycode>
Lines 310-321 __PACKAGE__->add_columns( Link Here
310
332
311
=cut
333
=cut
312
334
313
__PACKAGE__->set_primary_key("branchcode", "categorycode", "itemtype");
335
__PACKAGE__->add_unique_constraint(
336
  "issuingrules_selects",
337
  ["branchcode", "categorycode", "itemtype"],
338
);
314
339
315
340
316
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2017-04-27 19:15:48
341
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2017-04-27 19:15:48
317
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:D1443VWPcoIXN3+lIkckIQ
342
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:D1443VWPcoIXN3+lIkckIQ
318
343
319
320
# You can replace this text with custom code or comments, and it will be preserved on regeneration
344
# You can replace this text with custom code or comments, and it will be preserved on regeneration
321
1;
345
1;
(-)a/installer/data/mysql/atomicupdate/Bug-18231-id_to_ussingrules_table.sql (+3 lines)
Line 0 Link Here
1
ALTER TABLE `issuingrules` DROP PRIMARY KEY;
2
ALTER TABLE `issuingrules` ADD `issuingrules_id` INT( 11 ) NOT NULL auto_increment PRIMARY KEY FIRST;
3
ALTER TABLE `issuingrules` ADD CONSTRAINT UNIQUE `issuingrules_id` (`branchcode`,`categorycode`,`itemtype`);
(-)a/installer/data/mysql/kohastructure.sql (-2 / +3 lines)
Lines 853-858 CREATE TABLE `import_items` ( Link Here
853
853
854
DROP TABLE IF EXISTS `issuingrules`;
854
DROP TABLE IF EXISTS `issuingrules`;
855
CREATE TABLE `issuingrules` ( -- circulation and fine rules
855
CREATE TABLE `issuingrules` ( -- circulation and fine rules
856
  `issuingrules_id` int(11) NOT NULL auto_increment,
856
  `categorycode` varchar(10) NOT NULL default '', -- patron category this rule is for (categories.categorycode)
857
  `categorycode` varchar(10) NOT NULL default '', -- patron category this rule is for (categories.categorycode)
857
  `itemtype` varchar(10) NOT NULL default '', -- item type this rule is for (itemtypes.itemtype)
858
  `itemtype` varchar(10) NOT NULL default '', -- item type this rule is for (itemtypes.itemtype)
858
  `restrictedtype` tinyint(1) default NULL, -- not used? always NULL
859
  `restrictedtype` tinyint(1) default NULL, -- not used? always NULL
Lines 886-892 CREATE TABLE `issuingrules` ( -- circulation and fine rules Link Here
886
  onshelfholds tinyint(1) NOT NULL default 0, -- allow holds for items that are on shelf
887
  onshelfholds tinyint(1) NOT NULL default 0, -- allow holds for items that are on shelf
887
  opacitemholds char(1) NOT NULL default 'N', -- allow opac users to place specific items on hold
888
  opacitemholds char(1) NOT NULL default 'N', -- allow opac users to place specific items on hold
888
  article_requests enum('no','yes','bib_only','item_only') NOT NULL DEFAULT 'no', -- allow article requests to be placed,
889
  article_requests enum('no','yes','bib_only','item_only') NOT NULL DEFAULT 'no', -- allow article requests to be placed,
889
  PRIMARY KEY  (`branchcode`,`categorycode`,`itemtype`),
890
  PRIMARY KEY (`issuingrules_id`),
891
  UNIQUE KEY `issuingrules_selects` (`branchcode`,`categorycode`,`itemtype`),
890
  KEY `categorycode` (`categorycode`),
892
  KEY `categorycode` (`categorycode`),
891
  KEY `itemtype` (`itemtype`)
893
  KEY `itemtype` (`itemtype`)
892
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
894
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
893
- 

Return to bug 18231