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

(-)a/Koha/Patron/Relationship.pm (-1 / +1 lines)
Lines 67-73 sub guarantee { Link Here
67
=cut
67
=cut
68
68
69
sub _type {
69
sub _type {
70
    return 'Relationship';
70
    return 'BorrowerRelationship';
71
}
71
}
72
72
73
1;
73
1;
(-)a/Koha/Patron/Relationships.pm (-1 / +1 lines)
Lines 84-90 sub guarantees { Link Here
84
=cut
84
=cut
85
85
86
sub _type {
86
sub _type {
87
    return 'Relationship';
87
    return 'BorrowerRelationship';
88
}
88
}
89
89
90
sub object_class {
90
sub object_class {
(-)a/Koha/Schema/Result/Relationship.pm (-6 / +6 lines)
Lines 1-12 Link Here
1
use utf8;
1
use utf8;
2
package Koha::Schema::Result::Relationship;
2
package Koha::Schema::Result::BorrowerRelationship;
3
3
4
# Created by DBIx::Class::Schema::Loader
4
# Created by DBIx::Class::Schema::Loader
5
# DO NOT MODIFY THE FIRST PART OF THIS FILE
5
# DO NOT MODIFY THE FIRST PART OF THIS FILE
6
6
7
=head1 NAME
7
=head1 NAME
8
8
9
Koha::Schema::Result::Relationship
9
Koha::Schema::Result::BorrowerRelationship
10
10
11
=cut
11
=cut
12
12
Lines 15-25 use warnings; Link Here
15
15
16
use base 'DBIx::Class::Core';
16
use base 'DBIx::Class::Core';
17
17
18
=head1 TABLE: C<relationships>
18
=head1 TABLE: C<borrower_relationships>
19
19
20
=cut
20
=cut
21
21
22
__PACKAGE__->table("relationships");
22
__PACKAGE__->table("borrower_relationships");
23
23
24
=head1 ACCESSORS
24
=head1 ACCESSORS
25
25
Lines 124-131 __PACKAGE__->belongs_to( Link Here
124
);
124
);
125
125
126
126
127
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2016-05-03 13:19:34
127
# Created by DBIx::Class::Schema::Loader v0.07046 @ 2018-07-17 11:22:45
128
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:2Nv437KMrKHvpQleXLOjYw
128
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:YKFiZSR3WRi1nvtLOdGV9A
129
129
130
130
131
# You can replace this text with custom code or comments, and it will be preserved on regeneration
131
# You can replace this text with custom code or comments, and it will be preserved on regeneration
(-)a/installer/data/mysql/atomicupdate/bug_14570.sql (-2 / +4 lines)
Lines 1-4 Link Here
1
CREATE TABLE `relationships` (
1
CREATE TABLE `borrower_relationships` (
2
      id INT(11) NOT NULL AUTO_INCREMENT,
2
      id INT(11) NOT NULL AUTO_INCREMENT,
3
      guarantor_id INT(11) NULL DEFAULT NULL,
3
      guarantor_id INT(11) NULL DEFAULT NULL,
4
      guarantee_id INT(11) NOT NULL,
4
      guarantee_id INT(11) NOT NULL,
Lines 12-17 CREATE TABLE `relationships` ( Link Here
12
12
13
UPDATE borrowers LEFT JOIN borrowers guarantor ON ( borrowers.guarantorid = guarantor.borrowernumber ) SET borrowers.guarantorid = NULL WHERE guarantor.borrowernumber IS NULL;
13
UPDATE borrowers LEFT JOIN borrowers guarantor ON ( borrowers.guarantorid = guarantor.borrowernumber ) SET borrowers.guarantorid = NULL WHERE guarantor.borrowernumber IS NULL;
14
14
15
INSERT INTO relationships ( guarantor_id, guarantee_id, relationship, surname, firstname ) SELECT guarantorid, borrowernumber, relationship, contactname, contactfirstname FROM borrowers WHERE guarantorid IS NOT NULL OR contactname != "";
15
INSERT INTO borrower_relationships ( guarantor_id, guarantee_id, relationship, surname, firstname ) SELECT guarantorid, borrowernumber, relationship, contactname, contactfirstname FROM borrowers WHERE guarantorid IS NOT NULL OR contactname != "";
16
16
17
ALTER TABLE borrowers DROP guarantorid, DROP relationship, DROP contactname, DROP contactfirstname, DROP contacttitle;
17
ALTER TABLE borrowers DROP guarantorid, DROP relationship, DROP contactname, DROP contactfirstname, DROP contacttitle;
18
ALTER TABLE deletedborrowers DROP guarantorid, DROP relationship, DROP contactname, DROP contactfirstname, DROP contacttitle;
19
ALTER TABLE borrowermodification DROP guarantorid, DROP relationship, DROP contactname, DROP contactfirstname, DROP contacttitle;
(-)a/installer/data/mysql/kohastructure.sql (-3 / +2 lines)
Lines 4100-4107 CREATE TABLE IF NOT EXISTS club_fields ( Link Here
4100
-- Table structure for table 'guarantors_guarantees'
4100
-- Table structure for table 'guarantors_guarantees'
4101
--
4101
--
4102
4102
4103
DROP TABLE IF EXISTS relationships;
4103
DROP TABLE IF EXISTS borrower_relationships;
4104
CREATE TABLE `relationships` (
4104
CREATE TABLE `borrower_relationships` (
4105
      id INT(11) NOT NULL AUTO_INCREMENT,
4105
      id INT(11) NOT NULL AUTO_INCREMENT,
4106
      guarantor_id INT(11) NULL DEFAULT NULL,
4106
      guarantor_id INT(11) NULL DEFAULT NULL,
4107
      guarantee_id INT(11) NOT NULL,
4107
      guarantee_id INT(11) NOT NULL,
4108
- 

Return to bug 14570