Bug 19482: DBIC schema changes
[koha.git] / Koha / Schema / Result / CoverImage.pm
1 use utf8;
2 package Koha::Schema::Result::CoverImage;
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::CoverImage
10
11 =cut
12
13 use strict;
14 use warnings;
15
16 use base 'DBIx::Class::Core';
17
18 =head1 TABLE: C<cover_images>
19
20 =cut
21
22 __PACKAGE__->table("cover_images");
23
24 =head1 ACCESSORS
25
26 =head2 imagenumber
27
28   data_type: 'integer'
29   is_auto_increment: 1
30   is_nullable: 0
31
32 =head2 biblionumber
33
34   data_type: 'integer'
35   is_foreign_key: 1
36   is_nullable: 1
37
38 =head2 itemnumber
39
40   data_type: 'integer'
41   is_foreign_key: 1
42   is_nullable: 1
43
44 =head2 mimetype
45
46   data_type: 'varchar'
47   is_nullable: 0
48   size: 15
49
50 =head2 imagefile
51
52   data_type: 'mediumblob'
53   is_nullable: 0
54
55 =head2 thumbnail
56
57   data_type: 'mediumblob'
58   is_nullable: 0
59
60 =head2 timestamp
61
62   data_type: 'timestamp'
63   datetime_undef_if_invalid: 1
64   default_value: current_timestamp
65   is_nullable: 0
66
67 =cut
68
69 __PACKAGE__->add_columns(
70   "imagenumber",
71   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
72   "biblionumber",
73   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
74   "itemnumber",
75   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
76   "mimetype",
77   { data_type => "varchar", is_nullable => 0, size => 15 },
78   "imagefile",
79   { data_type => "mediumblob", is_nullable => 0 },
80   "thumbnail",
81   { data_type => "mediumblob", is_nullable => 0 },
82   "timestamp",
83   {
84     data_type => "timestamp",
85     datetime_undef_if_invalid => 1,
86     default_value => \"current_timestamp",
87     is_nullable => 0,
88   },
89 );
90
91 =head1 PRIMARY KEY
92
93 =over 4
94
95 =item * L</imagenumber>
96
97 =back
98
99 =cut
100
101 __PACKAGE__->set_primary_key("imagenumber");
102
103 =head1 RELATIONS
104
105 =head2 biblionumber
106
107 Type: belongs_to
108
109 Related object: L<Koha::Schema::Result::Biblio>
110
111 =cut
112
113 __PACKAGE__->belongs_to(
114   "biblionumber",
115   "Koha::Schema::Result::Biblio",
116   { biblionumber => "biblionumber" },
117   {
118     is_deferrable => 1,
119     join_type     => "LEFT",
120     on_delete     => "CASCADE",
121     on_update     => "CASCADE",
122   },
123 );
124
125 =head2 itemnumber
126
127 Type: belongs_to
128
129 Related object: L<Koha::Schema::Result::Item>
130
131 =cut
132
133 __PACKAGE__->belongs_to(
134   "itemnumber",
135   "Koha::Schema::Result::Item",
136   { itemnumber => "itemnumber" },
137   {
138     is_deferrable => 1,
139     join_type     => "LEFT",
140     on_delete     => "CASCADE",
141     on_update     => "CASCADE",
142   },
143 );
144
145
146 # Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-10-12 09:13:32
147 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:F8pfwsORemCIxoVAPIohXw
148
149
150 # You can replace this text with custom code or comments, and it will be preserved on regeneration
151 1;