Bug 31212: DBIC schema
[koha.git] / Koha / Schema / Result / LibrarySmtpServer.pm
1 use utf8;
2 package Koha::Schema::Result::LibrarySmtpServer;
3
4 # Created by DBIx::Class::Schema::Loader
5 # DO NOT MODIFY THE FIRST PART OF THIS FILE
6
7 =head1 NAME
8
9 Koha::Schema::Result::LibrarySmtpServer
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<library_smtp_servers>
19
20 =cut
21
22 __PACKAGE__->table("library_smtp_servers");
23
24 =head1 ACCESSORS
25
26 =head2 id
27
28   data_type: 'integer'
29   is_auto_increment: 1
30   is_nullable: 0
31
32 =head2 library_id
33
34   data_type: 'varchar'
35   is_foreign_key: 1
36   is_nullable: 0
37   size: 10
38
39 =head2 smtp_server_id
40
41   data_type: 'integer'
42   is_foreign_key: 1
43   is_nullable: 0
44
45 =cut
46
47 __PACKAGE__->add_columns(
48   "id",
49   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
50   "library_id",
51   { data_type => "varchar", is_foreign_key => 1, is_nullable => 0, size => 10 },
52   "smtp_server_id",
53   { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
54 );
55
56 =head1 PRIMARY KEY
57
58 =over 4
59
60 =item * L</id>
61
62 =back
63
64 =cut
65
66 __PACKAGE__->set_primary_key("id");
67
68 =head1 UNIQUE CONSTRAINTS
69
70 =head2 C<library_id_idx>
71
72 =over 4
73
74 =item * L</library_id>
75
76 =back
77
78 =cut
79
80 __PACKAGE__->add_unique_constraint("library_id_idx", ["library_id"]);
81
82 =head1 RELATIONS
83
84 =head2 library
85
86 Type: belongs_to
87
88 Related object: L<Koha::Schema::Result::Branch>
89
90 =cut
91
92 __PACKAGE__->belongs_to(
93   "library",
94   "Koha::Schema::Result::Branch",
95   { branchcode => "library_id" },
96   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
97 );
98
99 =head2 smtp_server
100
101 Type: belongs_to
102
103 Related object: L<Koha::Schema::Result::SmtpServer>
104
105 =cut
106
107 __PACKAGE__->belongs_to(
108   "smtp_server",
109   "Koha::Schema::Result::SmtpServer",
110   { id => "smtp_server_id" },
111   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
112 );
113
114
115 # Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-08-24 13:41:24
116 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:qKAQAs3VFcitIGDGra/zuw
117
118
119 # You can replace this text with custom code or comments, and it will be preserved on regeneration
120 1;