109 lines
1.7 KiB
Perl
109 lines
1.7 KiB
Perl
use utf8;
|
|
package PoorBooru::Schema::Result::Media;
|
|
|
|
# Created by DBIx::Class::Schema::Loader
|
|
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
|
|
|
=head1 NAME
|
|
|
|
PoorBooru::Schema::Result::Media
|
|
|
|
=cut
|
|
|
|
use strict;
|
|
use warnings;
|
|
|
|
use base 'DBIx::Class::Core';
|
|
|
|
=head1 TABLE: C<media>
|
|
|
|
=cut
|
|
|
|
__PACKAGE__->table("media");
|
|
|
|
=head1 ACCESSORS
|
|
|
|
=head2 media_id
|
|
|
|
data_type: 'integer'
|
|
is_auto_increment: 1
|
|
is_nullable: 0
|
|
|
|
=head2 content
|
|
|
|
data_type: 'blob'
|
|
is_nullable: 0
|
|
size: 10485760
|
|
|
|
=head2 filename
|
|
|
|
data_type: 'text'
|
|
is_nullable: 0
|
|
size: 255
|
|
|
|
=head2 content_type
|
|
|
|
data_type: 'text'
|
|
is_nullable: 1
|
|
size: 255
|
|
|
|
=cut
|
|
|
|
__PACKAGE__->add_columns(
|
|
"media_id",
|
|
{ data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
|
|
"content",
|
|
{ data_type => "blob", is_nullable => 0, size => 10485760 },
|
|
"filename",
|
|
{ data_type => "text", is_nullable => 0, size => 255 },
|
|
"content_type",
|
|
{ data_type => "text", is_nullable => 1, size => 255 },
|
|
);
|
|
|
|
=head1 PRIMARY KEY
|
|
|
|
=over 4
|
|
|
|
=item * L</media_id>
|
|
|
|
=back
|
|
|
|
=cut
|
|
|
|
__PACKAGE__->set_primary_key("media_id");
|
|
|
|
=head1 RELATIONS
|
|
|
|
=head2 media_tags
|
|
|
|
Type: has_many
|
|
|
|
Related object: L<PoorBooru::Schema::Result::MediaTag>
|
|
|
|
=cut
|
|
|
|
__PACKAGE__->has_many(
|
|
"media_tags",
|
|
"PoorBooru::Schema::Result::MediaTag",
|
|
{ "foreign.media_id" => "self.media_id" },
|
|
{ cascade_copy => 0, cascade_delete => 0 },
|
|
);
|
|
|
|
=head2 tags
|
|
|
|
Type: many_to_many
|
|
|
|
Composing rels: L</media_tags> -> tag
|
|
|
|
=cut
|
|
|
|
__PACKAGE__->many_to_many("tags", "media_tags", "tag");
|
|
|
|
|
|
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-02-18 09:09:31
|
|
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:X0A6CSw6yWOYvxhMNRoS0g
|
|
|
|
|
|
# You can replace this text with custom code or comments, and it will be preserved on regeneration
|
|
1;
|