Bug 9988 - DBRev 16.12.00.023
[koha.git] / Koha / Schema / Result / Virtualshelve.pm
1 use utf8;
2 package Koha::Schema::Result::Virtualshelve;
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::Virtualshelve
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<virtualshelves>
19
20 =cut
21
22 __PACKAGE__->table("virtualshelves");
23
24 =head1 ACCESSORS
25
26 =head2 shelfnumber
27
28   data_type: 'integer'
29   is_auto_increment: 1
30   is_nullable: 0
31
32 =head2 shelfname
33
34   data_type: 'varchar'
35   is_nullable: 1
36   size: 255
37
38 =head2 owner
39
40   data_type: 'integer'
41   is_foreign_key: 1
42   is_nullable: 1
43
44 =head2 category
45
46   data_type: 'varchar'
47   is_nullable: 1
48   size: 1
49
50 =head2 sortfield
51
52   data_type: 'varchar'
53   default_value: 'title'
54   is_nullable: 1
55   size: 16
56
57 =head2 lastmodified
58
59   data_type: 'timestamp'
60   datetime_undef_if_invalid: 1
61   default_value: current_timestamp
62   is_nullable: 0
63
64 =head2 created_on
65
66   data_type: 'datetime'
67   datetime_undef_if_invalid: 1
68   is_nullable: 0
69
70 =head2 allow_add
71
72   data_type: 'tinyint'
73   default_value: 0
74   is_nullable: 1
75
76 =head2 allow_delete_own
77
78   data_type: 'tinyint'
79   default_value: 1
80   is_nullable: 1
81
82 =head2 allow_delete_other
83
84   data_type: 'tinyint'
85   default_value: 0
86   is_nullable: 1
87
88 =cut
89
90 __PACKAGE__->add_columns(
91   "shelfnumber",
92   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
93   "shelfname",
94   { data_type => "varchar", is_nullable => 1, size => 255 },
95   "owner",
96   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
97   "category",
98   { data_type => "varchar", is_nullable => 1, size => 1 },
99   "sortfield",
100   {
101     data_type => "varchar",
102     default_value => "title",
103     is_nullable => 1,
104     size => 16,
105   },
106   "lastmodified",
107   {
108     data_type => "timestamp",
109     datetime_undef_if_invalid => 1,
110     default_value => \"current_timestamp",
111     is_nullable => 0,
112   },
113   "created_on",
114   {
115     data_type => "datetime",
116     datetime_undef_if_invalid => 1,
117     is_nullable => 0,
118   },
119   "allow_add",
120   { data_type => "tinyint", default_value => 0, is_nullable => 1 },
121   "allow_delete_own",
122   { data_type => "tinyint", default_value => 1, is_nullable => 1 },
123   "allow_delete_other",
124   { data_type => "tinyint", default_value => 0, is_nullable => 1 },
125 );
126
127 =head1 PRIMARY KEY
128
129 =over 4
130
131 =item * L</shelfnumber>
132
133 =back
134
135 =cut
136
137 __PACKAGE__->set_primary_key("shelfnumber");
138
139 =head1 RELATIONS
140
141 =head2 owner
142
143 Type: belongs_to
144
145 Related object: L<Koha::Schema::Result::Borrower>
146
147 =cut
148
149 __PACKAGE__->belongs_to(
150   "owner",
151   "Koha::Schema::Result::Borrower",
152   { borrowernumber => "owner" },
153   {
154     is_deferrable => 1,
155     join_type     => "LEFT",
156     on_delete     => "SET NULL",
157     on_update     => "SET NULL",
158   },
159 );
160
161 =head2 virtualshelfcontents
162
163 Type: has_many
164
165 Related object: L<Koha::Schema::Result::Virtualshelfcontent>
166
167 =cut
168
169 __PACKAGE__->has_many(
170   "virtualshelfcontents",
171   "Koha::Schema::Result::Virtualshelfcontent",
172   { "foreign.shelfnumber" => "self.shelfnumber" },
173   { cascade_copy => 0, cascade_delete => 0 },
174 );
175
176 =head2 virtualshelfshares
177
178 Type: has_many
179
180 Related object: L<Koha::Schema::Result::Virtualshelfshare>
181
182 =cut
183
184 __PACKAGE__->has_many(
185   "virtualshelfshares",
186   "Koha::Schema::Result::Virtualshelfshare",
187   { "foreign.shelfnumber" => "self.shelfnumber" },
188   { cascade_copy => 0, cascade_delete => 0 },
189 );
190
191
192 # Created by DBIx::Class::Schema::Loader v0.07042 @ 2016-09-06 09:35:37
193 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:wfAdz7LrmH49vdJ3f5rsmA
194
195
196 # You can replace this text with custom content, and it will be preserved on regeneration
197 1;