From b3b7e07062cf910f293ccfe0dfc8dc56ee5ee4d7 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 12 Oct 2020 12:34:43 +0200 Subject: [PATCH] Bug 26145: (follow-up) DBIC schema changes Signed-off-by: Jonathan Druart --- Koha/Schema/Result/CoverImage.pm | 151 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 151 insertions(+) create mode 100644 Koha/Schema/Result/CoverImage.pm diff --git a/Koha/Schema/Result/CoverImage.pm b/Koha/Schema/Result/CoverImage.pm new file mode 100644 index 0000000000..d8e9854132 --- /dev/null +++ b/Koha/Schema/Result/CoverImage.pm @@ -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 + +=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 + +=back + +=cut + +__PACKAGE__->set_primary_key("imagenumber"); + +=head1 RELATIONS + +=head2 biblionumber + +Type: belongs_to + +Related object: L + +=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 + +=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; -- 2.11.4.GIT