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

(-)a/Koha/Schema/Result/Item.pm (-10 / +6 lines)
Lines 729-744 __PACKAGE__->might_have( Link Here
729
  { cascade_copy => 0, cascade_delete => 0 },
729
  { cascade_copy => 0, cascade_delete => 0 },
730
);
730
);
731
731
732
=head2 item_group_items
732
=head2 item_group_item
733
733
734
Type: has_many
734
Type: might_have
735
735
736
Related object: L<Koha::Schema::Result::ItemGroupItem>
736
Related object: L<Koha::Schema::Result::ItemGroupItem>
737
737
738
=cut
738
=cut
739
739
740
__PACKAGE__->has_many(
740
__PACKAGE__->might_have(
741
  "item_group_items",
741
  "item_group_item",
742
  "Koha::Schema::Result::ItemGroupItem",
742
  "Koha::Schema::Result::ItemGroupItem",
743
  { "foreign.item_id" => "self.itemnumber" },
743
  { "foreign.item_id" => "self.itemnumber" },
744
  { cascade_copy => 0, cascade_delete => 0 },
744
  { cascade_copy => 0, cascade_delete => 0 },
Lines 880-891 __PACKAGE__->has_many( Link Here
880
);
880
);
881
881
882
882
883
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-09-01 12:37:33
883
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-09-01 12:52:33
884
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:1mLs4vLD2LsJGkBKZCZbXg
884
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:WeRY0B6a1D94WckYmUgWpQ
885
=======
886
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-08-18 14:00:35
887
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:WG9AuZsBgTMEWjlfwFQdeA
888
>>>>>>> Bug 24857: Rename Volumes => Item groups (DB)
889
885
890
__PACKAGE__->belongs_to( biblioitem => "Koha::Schema::Result::Biblioitem", "biblioitemnumber" );
886
__PACKAGE__->belongs_to( biblioitem => "Koha::Schema::Result::Biblioitem", "biblioitemnumber" );
891
887
(-)a/Koha/Schema/Result/ItemGroupItem.pm (-22 / +4 lines)
Lines 84-102 __PACKAGE__->set_primary_key("item_group_items_id"); Link Here
84
84
85
=head1 UNIQUE CONSTRAINTS
85
=head1 UNIQUE CONSTRAINTS
86
86
87
=head2 C<item_group_id>
87
=head2 C<item_id>
88
88
89
=over 4
89
=over 4
90
90
91
=item * L</item_group_id>
92
93
=item * L</item_id>
91
=item * L</item_id>
94
92
95
=back
93
=back
96
94
97
=cut
95
=cut
98
96
99
__PACKAGE__->add_unique_constraint("item_group_id", ["item_group_id", "item_id"]);
97
__PACKAGE__->add_unique_constraint("item_id", ["item_id"]);
100
98
101
=head1 RELATIONS
99
=head1 RELATIONS
102
100
Lines 131-154 __PACKAGE__->belongs_to( Link Here
131
);
129
);
132
130
133
131
134
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-09-01 12:37:33
132
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-09-01 12:52:33
135
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:zfCA4diZgiexDnY1rD6xkQ
133
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:y9cE5sPmUxcJFgAZfsEQsg
136
137
=head2 koha_object_class
138
139
=cut
140
141
sub koha_object_class {
142
    'Koha::Biblio::Volume::Item';
143
}
144
145
=head2 koha_objects_class
146
147
=cut
148
=======
149
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-08-18 14:00:35
150
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:UkFl9MLWlH8wy3T/AaVIdQ
151
>>>>>>> Bug 24857: Rename Volumes => Item groups (DB):Koha/Schema/Result/ItemGroupItem.pm
152
134
153
sub koha_object_class {
135
sub koha_object_class {
154
    'Koha::Biblio::ItemGroup::Item';
136
    'Koha::Biblio::ItemGroup::Item';
(-)a/installer/data/mysql/atomicupdate/bug_24857_item_groups.pl (-2 / +2 lines)
Lines 39-47 use Modern::Perl; Link Here
39
                    `item_group_id` INT(11) NOT NULL DEFAULT 0 COMMENT "foreign key making this table a 1 to 1 join from items to item groups",
39
                    `item_group_id` INT(11) NOT NULL DEFAULT 0 COMMENT "foreign key making this table a 1 to 1 join from items to item groups",
40
                    `item_id` INT(11) NOT NULL DEFAULT 0 COMMENT "foreign key linking this table to the items table",
40
                    `item_id` INT(11) NOT NULL DEFAULT 0 COMMENT "foreign key linking this table to the items table",
41
                    PRIMARY KEY  (`item_group_items_id`),
41
                    PRIMARY KEY  (`item_group_items_id`),
42
                    UNIQUE KEY (item_group_id,item_id),
42
                    UNIQUE KEY (`item_id`),
43
                    CONSTRAINT `item_group_items_iifk_1` FOREIGN KEY (`item_id`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
43
                    CONSTRAINT `item_group_items_iifk_1` FOREIGN KEY (`item_id`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
44
                    CONSTRAINT `item_group_items_vifk_1` FOREIGN KEY (`item_group_id`) REFERENCES `item_groups` (`item_group_id`) ON DELETE CASCADE ON UPDATE CASCADE
44
                    CONSTRAINT `item_group_items_gifk_1` FOREIGN KEY (`item_group_id`) REFERENCES `item_groups` (`item_group_id`) ON DELETE CASCADE ON UPDATE CASCADE
45
                ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
45
                ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
46
            });
46
            });
47
        }
47
        }
(-)a/installer/data/mysql/kohastructure.sql (-3 / +2 lines)
Lines 1833-1841 CREATE TABLE `item_group_items` ( Link Here
1833
  `item_group_id` INT(11) NOT NULL DEFAULT 0 COMMENT "foreign key making this table a 1 to 1 join from items to item groups",
1833
  `item_group_id` INT(11) NOT NULL DEFAULT 0 COMMENT "foreign key making this table a 1 to 1 join from items to item groups",
1834
  `item_id` INT(11) NOT NULL DEFAULT 0 COMMENT "foreign key linking this table to the items table",
1834
  `item_id` INT(11) NOT NULL DEFAULT 0 COMMENT "foreign key linking this table to the items table",
1835
  PRIMARY KEY  (`item_group_items_id`),
1835
  PRIMARY KEY  (`item_group_items_id`),
1836
  UNIQUE KEY (item_group_id,item_id),
1836
  UNIQUE KEY (`item_id`),
1837
  CONSTRAINT `item_group_items_iifk_1` FOREIGN KEY (`item_id`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
1837
  CONSTRAINT `item_group_items_iifk_1` FOREIGN KEY (`item_id`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
1838
  CONSTRAINT `item_group_items_vifk_1` FOREIGN KEY (`item_group_id`) REFERENCES `item_groups` (`item_group_id`) ON DELETE CASCADE ON UPDATE CASCADE
1838
  CONSTRAINT `item_group_items_gifk_1` FOREIGN KEY (`item_group_id`) REFERENCES `item_groups` (`item_group_id`) ON DELETE CASCADE ON UPDATE CASCADE
1839
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1839
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1840
1840
1841
--
1841
--
1842
- 

Return to bug 24857