2c24dec1bb08db4c68042c768f0e1849c0fa935f
[koha-equinox.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 =head2 borrowernumber
33
34   data_type: 'integer'
35   is_foreign_key: 1
36   is_nullable: 0
37
38 =head2 branchcode
39
40   data_type: 'varchar'
41   is_nullable: 1
42   size: 10
43
44 =head2 message_type
45
46   data_type: 'varchar'
47   is_nullable: 0
48   size: 1
49
50 =head2 message
51
52   data_type: 'mediumtext'
53   is_nullable: 0
54
55 =head2 message_date
56
57   data_type: 'timestamp'
58   datetime_undef_if_invalid: 1
59   default_value: current_timestamp
60   is_nullable: 0
61
62 =head2 manager_id
63
64   data_type: 'integer'
65   is_foreign_key: 1
66   is_nullable: 1
67
68 =cut
69
70 __PACKAGE__->add_columns(
71   "message_id",
72   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
73   "borrowernumber",
74   { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
75   "branchcode",
76   { data_type => "varchar", is_nullable => 1, size => 10 },
77   "message_type",
78   { data_type => "varchar", is_nullable => 0, size => 1 },
79   "message",
80   { data_type => "mediumtext", is_nullable => 0 },
81   "message_date",
82   {
83     data_type => "timestamp",
84     datetime_undef_if_invalid => 1,
85     default_value => \"current_timestamp",
86     is_nullable => 0,
87   },
88   "manager_id",
89   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
90 );
91
92 =head1 PRIMARY KEY
93
94 =over 4
95
96 =item * L</message_id>
97
98 =back
99
100 =cut
101
102 __PACKAGE__->set_primary_key("message_id");
103
104 =head1 RELATIONS
105
106 =head2 borrowernumber
107
108 Type: belongs_to
109
110 Related object: L<Koha::Schema::Result::Borrower>
111
112 =cut
113
114 __PACKAGE__->belongs_to(
115   "borrowernumber",
116   "Koha::Schema::Result::Borrower",
117   { borrowernumber => "borrowernumber" },
118   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
119 );
120
121 =head2 manager
122
123 Type: belongs_to
124
125 Related object: L<Koha::Schema::Result::Borrower>
126
127 =cut
128
129 __PACKAGE__->belongs_to(
130   "manager",
131   "Koha::Schema::Result::Borrower",
132   { borrowernumber => "manager_id" },
133   {
134     is_deferrable => 1,
135     join_type     => "LEFT",
136     on_delete     => "SET NULL",
137     on_update     => "RESTRICT",
138   },
139 );
140
141
142 # Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-02-15 13:15:09
143 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:kYM+0CFPm/wdNp7EosdlRw
144
145
146 # You can replace this text with custom content, and it will be preserved on regeneration
147 1;