Bug 25655: DBIC schema
[srvgit] / Koha / Schema / Result / ErmDocument.pm
1 use utf8;
2 package Koha::Schema::Result::ErmDocument;
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::ErmDocument
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<erm_documents>
19
20 =cut
21
22 __PACKAGE__->table("erm_documents");
23
24 =head1 ACCESSORS
25
26 =head2 document_id
27
28   data_type: 'integer'
29   is_auto_increment: 1
30   is_nullable: 0
31
32 primary key
33
34 =head2 agreement_id
35
36   data_type: 'integer'
37   is_foreign_key: 1
38   is_nullable: 1
39
40 link to the agreement
41
42 =head2 license_id
43
44   data_type: 'integer'
45   is_foreign_key: 1
46   is_nullable: 1
47
48 link to the license
49
50 =head2 file_name
51
52   data_type: 'varchar'
53   is_nullable: 1
54   size: 255
55
56 name of the file
57
58 =head2 file_type
59
60   data_type: 'varchar'
61   is_nullable: 1
62   size: 255
63
64 type of the file
65
66 =head2 file_description
67
68   data_type: 'varchar'
69   is_nullable: 1
70   size: 255
71
72 description of the file
73
74 =head2 file_content
75
76   data_type: 'longblob'
77   is_nullable: 1
78
79 the content of the file
80
81 =head2 uploaded_on
82
83   data_type: 'datetime'
84   datetime_undef_if_invalid: 1
85   is_nullable: 1
86
87 datetime when the file as attached
88
89 =head2 physical_location
90
91   data_type: 'varchar'
92   is_nullable: 1
93   size: 255
94
95 physical location of the document
96
97 =head2 uri
98
99   data_type: 'varchar'
100   is_nullable: 1
101   size: 255
102
103 URI of the document
104
105 =head2 notes
106
107   data_type: 'mediumtext'
108   is_nullable: 1
109
110 notes about this relationship
111
112 =cut
113
114 __PACKAGE__->add_columns(
115   "document_id",
116   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
117   "agreement_id",
118   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
119   "license_id",
120   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
121   "file_name",
122   { data_type => "varchar", is_nullable => 1, size => 255 },
123   "file_type",
124   { data_type => "varchar", is_nullable => 1, size => 255 },
125   "file_description",
126   { data_type => "varchar", is_nullable => 1, size => 255 },
127   "file_content",
128   { data_type => "longblob", is_nullable => 1 },
129   "uploaded_on",
130   {
131     data_type => "datetime",
132     datetime_undef_if_invalid => 1,
133     is_nullable => 1,
134   },
135   "physical_location",
136   { data_type => "varchar", is_nullable => 1, size => 255 },
137   "uri",
138   { data_type => "varchar", is_nullable => 1, size => 255 },
139   "notes",
140   { data_type => "mediumtext", is_nullable => 1 },
141 );
142
143 =head1 PRIMARY KEY
144
145 =over 4
146
147 =item * L</document_id>
148
149 =back
150
151 =cut
152
153 __PACKAGE__->set_primary_key("document_id");
154
155 =head1 RELATIONS
156
157 =head2 agreement
158
159 Type: belongs_to
160
161 Related object: L<Koha::Schema::Result::ErmAgreement>
162
163 =cut
164
165 __PACKAGE__->belongs_to(
166   "agreement",
167   "Koha::Schema::Result::ErmAgreement",
168   { agreement_id => "agreement_id" },
169   {
170     is_deferrable => 1,
171     join_type     => "LEFT",
172     on_delete     => "CASCADE",
173     on_update     => "CASCADE",
174   },
175 );
176
177 =head2 license
178
179 Type: belongs_to
180
181 Related object: L<Koha::Schema::Result::ErmLicense>
182
183 =cut
184
185 __PACKAGE__->belongs_to(
186   "license",
187   "Koha::Schema::Result::ErmLicense",
188   { license_id => "license_id" },
189   {
190     is_deferrable => 1,
191     join_type     => "LEFT",
192     on_delete     => "CASCADE",
193     on_update     => "CASCADE",
194   },
195 );
196
197
198 # Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-10-21 09:22:27
199 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:rbU2G4zjKlEcOtuwVBSXaw
200
201 sub koha_object_class {
202     'Koha::ERM::Document';
203 }
204 sub koha_objects_class {
205     'Koha::ERM::Documents';
206 }
207
208 1;