Bug 21395: Fix creation of PO file
[koha.git] / Koha / Schema / Result / BorrowerRelationship.pm
blob04a5c10cd6b034aecc313c76120dad9bf1d5b601
1 use utf8;
2 package Koha::Schema::Result::BorrowerRelationship;
4 # Created by DBIx::Class::Schema::Loader
5 # DO NOT MODIFY THE FIRST PART OF THIS FILE
7 =head1 NAME
9 Koha::Schema::Result::BorrowerRelationship
11 =cut
13 use strict;
14 use warnings;
16 use base 'DBIx::Class::Core';
18 =head1 TABLE: C<borrower_relationships>
20 =cut
22 __PACKAGE__->table("borrower_relationships");
24 =head1 ACCESSORS
26 =head2 id
28 data_type: 'integer'
29 is_auto_increment: 1
30 is_nullable: 0
32 =head2 guarantor_id
34 data_type: 'integer'
35 is_foreign_key: 1
36 is_nullable: 1
38 =head2 guarantee_id
40 data_type: 'integer'
41 is_foreign_key: 1
42 is_nullable: 0
44 =head2 relationship
46 data_type: 'varchar'
47 is_nullable: 0
48 size: 100
50 =cut
52 __PACKAGE__->add_columns(
53 "id",
54 { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
55 "guarantor_id",
56 { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
57 "guarantee_id",
58 { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
59 "relationship",
60 { data_type => "varchar", is_nullable => 0, size => 100 },
63 =head1 PRIMARY KEY
65 =over 4
67 =item * L</id>
69 =back
71 =cut
73 __PACKAGE__->set_primary_key("id");
75 =head1 UNIQUE CONSTRAINTS
77 =head2 C<guarantor_guarantee_idx>
79 =over 4
81 =item * L</guarantor_id>
83 =item * L</guarantee_id>
85 =back
87 =cut
89 __PACKAGE__->add_unique_constraint("guarantor_guarantee_idx", ["guarantor_id", "guarantee_id"]);
91 =head1 RELATIONS
93 =head2 guarantee
95 Type: belongs_to
97 Related object: L<Koha::Schema::Result::Borrower>
99 =cut
101 __PACKAGE__->belongs_to(
102 "guarantee",
103 "Koha::Schema::Result::Borrower",
104 { borrowernumber => "guarantee_id" },
105 { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
108 =head2 guarantor
110 Type: belongs_to
112 Related object: L<Koha::Schema::Result::Borrower>
114 =cut
116 __PACKAGE__->belongs_to(
117 "guarantor",
118 "Koha::Schema::Result::Borrower",
119 { borrowernumber => "guarantor_id" },
121 is_deferrable => 1,
122 join_type => "LEFT",
123 on_delete => "CASCADE",
124 on_update => "CASCADE",
129 # Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-08-20 15:14:37
130 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ZymvWAn9Nzfuh1lExUIhIg
132 sub koha_objects_class {
133 'Koha::Patron::Relationships';
135 sub koha_object_class {
136 'Koha::Patron::Relationship';