Bug 12446: (QA follow-up) Minor kohastructure.sql fix
[koha.git] / Koha / Schema / Result / Virtualshelfshare.pm
1 use utf8;
2 package Koha::Schema::Result::Virtualshelfshare;
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::Virtualshelfshare
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<virtualshelfshares>
19
20 =cut
21
22 __PACKAGE__->table("virtualshelfshares");
23
24 =head1 ACCESSORS
25
26 =head2 id
27
28   data_type: 'integer'
29   is_auto_increment: 1
30   is_nullable: 0
31
32 unique key
33
34 =head2 shelfnumber
35
36   data_type: 'integer'
37   is_foreign_key: 1
38   is_nullable: 0
39
40 foreign key for virtualshelves
41
42 =head2 borrowernumber
43
44   data_type: 'integer'
45   is_foreign_key: 1
46   is_nullable: 1
47
48 borrower that accepted access to this list
49
50 =head2 invitekey
51
52   data_type: 'varchar'
53   is_nullable: 1
54   size: 10
55
56 temporary string used in accepting the invitation to access thist list; not-empty means that the invitation has not been accepted yet
57
58 =head2 sharedate
59
60   data_type: 'datetime'
61   datetime_undef_if_invalid: 1
62   is_nullable: 1
63
64 date of invitation or acceptance of invitation
65
66 =cut
67
68 __PACKAGE__->add_columns(
69   "id",
70   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
71   "shelfnumber",
72   { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
73   "borrowernumber",
74   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
75   "invitekey",
76   { data_type => "varchar", is_nullable => 1, size => 10 },
77   "sharedate",
78   {
79     data_type => "datetime",
80     datetime_undef_if_invalid => 1,
81     is_nullable => 1,
82   },
83 );
84
85 =head1 PRIMARY KEY
86
87 =over 4
88
89 =item * L</id>
90
91 =back
92
93 =cut
94
95 __PACKAGE__->set_primary_key("id");
96
97 =head1 RELATIONS
98
99 =head2 borrowernumber
100
101 Type: belongs_to
102
103 Related object: L<Koha::Schema::Result::Borrower>
104
105 =cut
106
107 __PACKAGE__->belongs_to(
108   "borrowernumber",
109   "Koha::Schema::Result::Borrower",
110   { borrowernumber => "borrowernumber" },
111   {
112     is_deferrable => 1,
113     join_type     => "LEFT",
114     on_delete     => "SET NULL",
115     on_update     => "SET NULL",
116   },
117 );
118
119 =head2 shelfnumber
120
121 Type: belongs_to
122
123 Related object: L<Koha::Schema::Result::Virtualshelve>
124
125 =cut
126
127 __PACKAGE__->belongs_to(
128   "shelfnumber",
129   "Koha::Schema::Result::Virtualshelve",
130   { shelfnumber => "shelfnumber" },
131   { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
132 );
133
134
135 # Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-01-21 13:39:29
136 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Aovcx4icmIsaRskB9qUSlA
137
138
139 # You can replace this text with custom content, and it will be preserved on regeneration
140 1;