Bug 26145: (follow-up) DBIC schema changes
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
parent
d2c59eda85
commit
b3b7e07062
|
|
@ -0,0 +1,151 @@
|
|||
use utf8;
|
||||
package Koha::Schema::Result::CoverImage;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Koha::Schema::Result::CoverImage
|
||||
|
||||
=cut
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use base 'DBIx::Class::Core';
|
||||
|
||||
=head1 TABLE: C<cover_images>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->table("cover_images");
|
||||
|
||||
=head1 ACCESSORS
|
||||
|
||||
=head2 imagenumber
|
||||
|
||||
data_type: 'integer'
|
||||
is_auto_increment: 1
|
||||
is_nullable: 0
|
||||
|
||||
=head2 biblionumber
|
||||
|
||||
data_type: 'integer'
|
||||
is_foreign_key: 1
|
||||
is_nullable: 1
|
||||
|
||||
=head2 itemnumber
|
||||
|
||||
data_type: 'integer'
|
||||
is_foreign_key: 1
|
||||
is_nullable: 1
|
||||
|
||||
=head2 mimetype
|
||||
|
||||
data_type: 'varchar'
|
||||
is_nullable: 0
|
||||
size: 15
|
||||
|
||||
=head2 imagefile
|
||||
|
||||
data_type: 'mediumblob'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 thumbnail
|
||||
|
||||
data_type: 'mediumblob'
|
||||
is_nullable: 0
|
||||
|
||||
=head2 timestamp
|
||||
|
||||
data_type: 'timestamp'
|
||||
datetime_undef_if_invalid: 1
|
||||
default_value: current_timestamp
|
||||
is_nullable: 0
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->add_columns(
|
||||
"imagenumber",
|
||||
{ data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
|
||||
"biblionumber",
|
||||
{ data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
|
||||
"itemnumber",
|
||||
{ data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
|
||||
"mimetype",
|
||||
{ data_type => "varchar", is_nullable => 0, size => 15 },
|
||||
"imagefile",
|
||||
{ data_type => "mediumblob", is_nullable => 0 },
|
||||
"thumbnail",
|
||||
{ data_type => "mediumblob", is_nullable => 0 },
|
||||
"timestamp",
|
||||
{
|
||||
data_type => "timestamp",
|
||||
datetime_undef_if_invalid => 1,
|
||||
default_value => \"current_timestamp",
|
||||
is_nullable => 0,
|
||||
},
|
||||
);
|
||||
|
||||
=head1 PRIMARY KEY
|
||||
|
||||
=over 4
|
||||
|
||||
=item * L</imagenumber>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->set_primary_key("imagenumber");
|
||||
|
||||
=head1 RELATIONS
|
||||
|
||||
=head2 biblionumber
|
||||
|
||||
Type: belongs_to
|
||||
|
||||
Related object: L<Koha::Schema::Result::Biblio>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->belongs_to(
|
||||
"biblionumber",
|
||||
"Koha::Schema::Result::Biblio",
|
||||
{ biblionumber => "biblionumber" },
|
||||
{
|
||||
is_deferrable => 1,
|
||||
join_type => "LEFT",
|
||||
on_delete => "CASCADE",
|
||||
on_update => "CASCADE",
|
||||
},
|
||||
);
|
||||
|
||||
=head2 itemnumber
|
||||
|
||||
Type: belongs_to
|
||||
|
||||
Related object: L<Koha::Schema::Result::Item>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->belongs_to(
|
||||
"itemnumber",
|
||||
"Koha::Schema::Result::Item",
|
||||
{ itemnumber => "itemnumber" },
|
||||
{
|
||||
is_deferrable => 1,
|
||||
join_type => "LEFT",
|
||||
on_delete => "CASCADE",
|
||||
on_update => "CASCADE",
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-10-12 09:13:32
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:F8pfwsORemCIxoVAPIohXw
|
||||
|
||||
|
||||
# You can replace this text with custom code or comments, and it will be preserved on regeneration
|
||||
1;
|
||||
Loading…
Reference in New Issue