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

(-)a/Koha/Schema/Result/Issuingrule.pm (-3 / +28 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 212-217 __PACKAGE__->table("issuingrules"); Link Here
212
=cut
218
=cut
213
219
214
__PACKAGE__->add_columns(
220
__PACKAGE__->add_columns(
221
  "issuingrules_id",
222
  { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
215
  "categorycode",
223
  "categorycode",
216
  { data_type => "varchar", default_value => "", is_nullable => 0, size => 10 },
224
  { data_type => "varchar", default_value => "", is_nullable => 0, size => 10 },
217
  "itemtype",
225
  "itemtype",
Lines 292-297 __PACKAGE__->add_columns( Link Here
292
300
293
=over 4
301
=over 4
294
302
303
=item * L</issuingrules_id>
304
305
=back
306
307
=cut
308
309
__PACKAGE__->set_primary_key("issuingrules_id");
310
311
=head1 UNIQUE CONSTRAINTS
312
313
=head2 C<issuingrules_selects>
314
315
=over 4
316
295
=item * L</branchcode>
317
=item * L</branchcode>
296
318
297
=item * L</categorycode>
319
=item * L</categorycode>
Lines 302-312 __PACKAGE__->add_columns( Link Here
302
324
303
=cut
325
=cut
304
326
305
__PACKAGE__->set_primary_key("branchcode", "categorycode", "itemtype");
327
__PACKAGE__->add_unique_constraint(
328
  "issuingrules_selects",
329
  ["branchcode", "categorycode", "itemtype"],
330
);
306
331
307
332
308
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2016-11-02 10:33:37
333
# Created by DBIx::Class::Schema::Loader v0.07045 @ 2017-03-08 15:49:48
309
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:t9AhZLbm4SE7mx25LAyhGA
334
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:714V5KtlVyeDUidAdc2m/g
310
335
311
336
312
# You can replace this text with custom code or comments, and it will be preserved on regeneration
337
# You can replace this text with custom code or comments, and it will be preserved on regeneration
(-)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 845-850 CREATE TABLE `import_items` ( Link Here
845
845
846
DROP TABLE IF EXISTS `issuingrules`;
846
DROP TABLE IF EXISTS `issuingrules`;
847
CREATE TABLE `issuingrules` ( -- circulation and fine rules
847
CREATE TABLE `issuingrules` ( -- circulation and fine rules
848
  `issuingrules_id` int(11) NOT NULL auto_increment,
848
  `categorycode` varchar(10) NOT NULL default '', -- patron category this rule is for (categories.categorycode)
849
  `categorycode` varchar(10) NOT NULL default '', -- patron category this rule is for (categories.categorycode)
849
  `itemtype` varchar(10) NOT NULL default '', -- item type this rule is for (itemtypes.itemtype)
850
  `itemtype` varchar(10) NOT NULL default '', -- item type this rule is for (itemtypes.itemtype)
850
  `restrictedtype` tinyint(1) default NULL, -- not used? always NULL
851
  `restrictedtype` tinyint(1) default NULL, -- not used? always NULL
Lines 877-883 CREATE TABLE `issuingrules` ( -- circulation and fine rules Link Here
877
  onshelfholds tinyint(1) NOT NULL default 0, -- allow holds for items that are on shelf
878
  onshelfholds tinyint(1) NOT NULL default 0, -- allow holds for items that are on shelf
878
  opacitemholds char(1) NOT NULL default 'N', -- allow opac users to place specific items on hold
879
  opacitemholds char(1) NOT NULL default 'N', -- allow opac users to place specific items on hold
879
  article_requests enum('no','yes','bib_only','item_only') NOT NULL DEFAULT 'no', -- allow article requests to be placed,
880
  article_requests enum('no','yes','bib_only','item_only') NOT NULL DEFAULT 'no', -- allow article requests to be placed,
880
  PRIMARY KEY  (`branchcode`,`categorycode`,`itemtype`),
881
  PRIMARY KEY (`issuingrules_id`),
882
  UNIQUE KEY `issuingrules_selects` (`branchcode`,`categorycode`,`itemtype`),
881
  KEY `categorycode` (`categorycode`),
883
  KEY `categorycode` (`categorycode`),
882
  KEY `itemtype` (`itemtype`)
884
  KEY `itemtype` (`itemtype`)
883
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
885
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
884
- 

Return to bug 18231