Bug 32257: Label for patron attributes misaligned
[koha-ffzg.git] / Koha / Schema / Result / Message.pm
1 use utf8;
2 package Koha::Schema::Result::Message;
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::Message
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<messages>
19
20 =cut
21
22 __PACKAGE__->table("messages");
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 unique identifier assigned by Koha
33
34 =head2 borrowernumber
35
36   data_type: 'integer'
37   is_foreign_key: 1
38   is_nullable: 0
39
40 foreign key linking this message to the borrowers table
41
42 =head2 branchcode
43
44   data_type: 'varchar'
45   is_nullable: 1
46   size: 10
47
48 foreign key linking the message to the branches table
49
50 =head2 message_type
51
52   data_type: 'varchar'
53   is_nullable: 0
54   size: 1
55
56 whether the message is for the librarians (L) or the patron (B)
57
58 =head2 message
59
60   data_type: 'mediumtext'
61   is_nullable: 0
62
63 the text of the message
64
65 =head2 message_date
66
67   data_type: 'timestamp'
68   datetime_undef_if_invalid: 1
69   default_value: current_timestamp
70   is_nullable: 0
71
72 the date and time the message was written
73
74 =head2 manager_id
75
76   data_type: 'integer'
77   is_foreign_key: 1
78   is_nullable: 1
79
80 creator of message
81
82 =cut
83
84 __PACKAGE__->add_columns(
85   "message_id",
86   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
87   "borrowernumber",
88   { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
89   "branchcode",
90   { data_type => "varchar", is_nullable => 1, size => 10 },
91   "message_type",
92   { data_type => "varchar", is_nullable => 0, size => 1 },
93   "message",
94   { data_type => "mediumtext", is_nullable => 0 },
95   "message_date",
96   {
97     data_type => "timestamp",
98     datetime_undef_if_invalid => 1,
99     default_value => \"current_timestamp",
100     is_nullable => 0,
101   },
102   "manager_id",
103   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
104 );
105
106 =head1 PRIMARY KEY
107
108 =over 4
109
110 =item * L</message_id>
111
112 =back
113
114 =cut
115
116 __PACKAGE__->set_primary_key("message_id");
117
118 =head1 RELATIONS
119
120 =head2 borrowernumber
121
122 Type: belongs_to
123
124 Related object: L<Koha::Schema::Result::Borrower>
125
126 =cut
127
128 __PACKAGE__->belongs_to(
129   "borrowernumber",
130   "Koha::Schema::Result::Borrower",
131   { borrowernumber => "borrowernumber" },
132   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
133 );
134
135 =head2 manager
136
137 Type: belongs_to
138
139 Related object: L<Koha::Schema::Result::Borrower>
140
141 =cut
142
143 __PACKAGE__->belongs_to(
144   "manager",
145   "Koha::Schema::Result::Borrower",
146   { borrowernumber => "manager_id" },
147   {
148     is_deferrable => 1,
149     join_type     => "LEFT",
150     on_delete     => "SET NULL",
151     on_update     => "RESTRICT",
152   },
153 );
154
155
156 # Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-01-21 13:39:29
157 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:EvxjiNgWGReZ9rEVmS5YVw
158
159 sub koha_object_class {
160     'Koha::Patron::Message';
161 }
162 sub koha_objects_class {
163     'Koha::Patron::Messages';
164 }
165
166 1;