Bug 23152: Implement koha_object[s]_class when needed
[koha-equinox.git] / Koha / Schema / Result / MessageQueue.pm
1 use utf8;
2 package Koha::Schema::Result::MessageQueue;
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::MessageQueue
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<message_queue>
19
20 =cut
21
22 __PACKAGE__->table("message_queue");
23
24 =head1 ACCESSORS
25
26 =head2 message_id
27
28   data_type: 'integer'
29   is_auto_increment: 1
30   is_nullable: 0
31
32 =head2 borrowernumber
33
34   data_type: 'integer'
35   is_foreign_key: 1
36   is_nullable: 1
37
38 =head2 subject
39
40   data_type: 'mediumtext'
41   is_nullable: 1
42
43 =head2 content
44
45   data_type: 'mediumtext'
46   is_nullable: 1
47
48 =head2 metadata
49
50   data_type: 'mediumtext'
51   is_nullable: 1
52
53 =head2 letter_code
54
55   data_type: 'varchar'
56   is_nullable: 1
57   size: 64
58
59 =head2 message_transport_type
60
61   data_type: 'varchar'
62   is_foreign_key: 1
63   is_nullable: 0
64   size: 20
65
66 =head2 status
67
68   data_type: 'enum'
69   default_value: 'pending'
70   extra: {list => ["sent","pending","failed","deleted"]}
71   is_nullable: 0
72
73 =head2 time_queued
74
75   data_type: 'timestamp'
76   datetime_undef_if_invalid: 1
77   default_value: current_timestamp
78   is_nullable: 0
79
80 =head2 to_address
81
82   data_type: 'longtext'
83   is_nullable: 1
84
85 =head2 from_address
86
87   data_type: 'longtext'
88   is_nullable: 1
89
90 =head2 content_type
91
92   data_type: 'mediumtext'
93   is_nullable: 1
94
95 =cut
96
97 __PACKAGE__->add_columns(
98   "message_id",
99   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
100   "borrowernumber",
101   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
102   "subject",
103   { data_type => "mediumtext", is_nullable => 1 },
104   "content",
105   { data_type => "mediumtext", is_nullable => 1 },
106   "metadata",
107   { data_type => "mediumtext", is_nullable => 1 },
108   "letter_code",
109   { data_type => "varchar", is_nullable => 1, size => 64 },
110   "message_transport_type",
111   { data_type => "varchar", is_foreign_key => 1, is_nullable => 0, size => 20 },
112   "status",
113   {
114     data_type => "enum",
115     default_value => "pending",
116     extra => { list => ["sent", "pending", "failed", "deleted"] },
117     is_nullable => 0,
118   },
119   "time_queued",
120   {
121     data_type => "timestamp",
122     datetime_undef_if_invalid => 1,
123     default_value => \"current_timestamp",
124     is_nullable => 0,
125   },
126   "to_address",
127   { data_type => "longtext", is_nullable => 1 },
128   "from_address",
129   { data_type => "longtext", is_nullable => 1 },
130   "content_type",
131   { data_type => "mediumtext", is_nullable => 1 },
132 );
133
134 =head1 PRIMARY KEY
135
136 =over 4
137
138 =item * L</message_id>
139
140 =back
141
142 =cut
143
144 __PACKAGE__->set_primary_key("message_id");
145
146 =head1 RELATIONS
147
148 =head2 borrowernumber
149
150 Type: belongs_to
151
152 Related object: L<Koha::Schema::Result::Borrower>
153
154 =cut
155
156 __PACKAGE__->belongs_to(
157   "borrowernumber",
158   "Koha::Schema::Result::Borrower",
159   { borrowernumber => "borrowernumber" },
160   {
161     is_deferrable => 1,
162     join_type     => "LEFT",
163     on_delete     => "CASCADE",
164     on_update     => "CASCADE",
165   },
166 );
167
168 =head2 message_transport_type
169
170 Type: belongs_to
171
172 Related object: L<Koha::Schema::Result::MessageTransportType>
173
174 =cut
175
176 __PACKAGE__->belongs_to(
177   "message_transport_type",
178   "Koha::Schema::Result::MessageTransportType",
179   { message_transport_type => "message_transport_type" },
180   { is_deferrable => 1, on_delete => "RESTRICT", on_update => "CASCADE" },
181 );
182
183
184 # Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-16 17:54:54
185 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:9u39S/GLtZwnZGp+xcZOBA
186
187 sub koha_object_class {
188     'Koha::Notice::Message';
189 }
190 sub koha_objects_class {
191     'Koha::Notice::Messages';
192 }
193
194 1;