Bug 12558: DBIx::Class schema update 07/2014
[koha.git] / Koha / Schema / Result / Virtualshelve.pm
blob1811b4cebecb8384494f434fb75a0fe734df033b
1 use utf8;
2 package Koha::Schema::Result::Virtualshelve;
4 # Created by DBIx::Class::Schema::Loader
5 # DO NOT MODIFY THE FIRST PART OF THIS FILE
7 =head1 NAME
9 Koha::Schema::Result::Virtualshelve
11 =cut
13 use strict;
14 use warnings;
16 use base 'DBIx::Class::Core';
18 =head1 TABLE: C<virtualshelves>
20 =cut
22 __PACKAGE__->table("virtualshelves");
24 =head1 ACCESSORS
26 =head2 shelfnumber
28 data_type: 'integer'
29 is_auto_increment: 1
30 is_nullable: 0
32 =head2 shelfname
34 data_type: 'varchar'
35 is_nullable: 1
36 size: 255
38 =head2 owner
40 data_type: 'integer'
41 is_foreign_key: 1
42 is_nullable: 1
44 =head2 category
46 data_type: 'varchar'
47 is_nullable: 1
48 size: 1
50 =head2 sortfield
52 data_type: 'varchar'
53 is_nullable: 1
54 size: 16
56 =head2 lastmodified
58 data_type: 'timestamp'
59 datetime_undef_if_invalid: 1
60 default_value: current_timestamp
61 is_nullable: 0
63 =head2 allow_add
65 data_type: 'tinyint'
66 default_value: 0
67 is_nullable: 1
69 =head2 allow_delete_own
71 data_type: 'tinyint'
72 default_value: 1
73 is_nullable: 1
75 =head2 allow_delete_other
77 data_type: 'tinyint'
78 default_value: 0
79 is_nullable: 1
81 =cut
83 __PACKAGE__->add_columns(
84 "shelfnumber",
85 { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
86 "shelfname",
87 { data_type => "varchar", is_nullable => 1, size => 255 },
88 "owner",
89 { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
90 "category",
91 { data_type => "varchar", is_nullable => 1, size => 1 },
92 "sortfield",
93 { data_type => "varchar", is_nullable => 1, size => 16 },
94 "lastmodified",
96 data_type => "timestamp",
97 datetime_undef_if_invalid => 1,
98 default_value => \"current_timestamp",
99 is_nullable => 0,
101 "allow_add",
102 { data_type => "tinyint", default_value => 0, is_nullable => 1 },
103 "allow_delete_own",
104 { data_type => "tinyint", default_value => 1, is_nullable => 1 },
105 "allow_delete_other",
106 { data_type => "tinyint", default_value => 0, is_nullable => 1 },
109 =head1 PRIMARY KEY
111 =over 4
113 =item * L</shelfnumber>
115 =back
117 =cut
119 __PACKAGE__->set_primary_key("shelfnumber");
121 =head1 RELATIONS
123 =head2 owner
125 Type: belongs_to
127 Related object: L<Koha::Schema::Result::Borrower>
129 =cut
131 __PACKAGE__->belongs_to(
132 "owner",
133 "Koha::Schema::Result::Borrower",
134 { borrowernumber => "owner" },
136 is_deferrable => 1,
137 join_type => "LEFT",
138 on_delete => "SET NULL",
139 on_update => "SET NULL",
143 =head2 virtualshelfcontents
145 Type: has_many
147 Related object: L<Koha::Schema::Result::Virtualshelfcontent>
149 =cut
151 __PACKAGE__->has_many(
152 "virtualshelfcontents",
153 "Koha::Schema::Result::Virtualshelfcontent",
154 { "foreign.shelfnumber" => "self.shelfnumber" },
155 { cascade_copy => 0, cascade_delete => 0 },
158 =head2 virtualshelfshares
160 Type: has_many
162 Related object: L<Koha::Schema::Result::Virtualshelfshare>
164 =cut
166 __PACKAGE__->has_many(
167 "virtualshelfshares",
168 "Koha::Schema::Result::Virtualshelfshare",
169 { "foreign.shelfnumber" => "self.shelfnumber" },
170 { cascade_copy => 0, cascade_delete => 0 },
174 # Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-07-11 09:26:55
175 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:xRDCzpS+CXPdp4Mlp2WP6A
178 # You can replace this text with custom content, and it will be preserved on regeneration