db: rework schema and infrastructure
This commit is contained in:
parent
fbcaea8bfc
commit
13a6d287af
7 changed files with 86 additions and 85 deletions
|
@ -29,35 +29,35 @@ __PACKAGE__->table("media");
|
|||
is_auto_increment: 1
|
||||
is_nullable: 0
|
||||
|
||||
=head2 content
|
||||
=head2 seaweedfs_fid
|
||||
|
||||
data_type: 'blob'
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
size: 10485760
|
||||
size: 33
|
||||
|
||||
=head2 filename
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
size: 255
|
||||
size: 256
|
||||
|
||||
=head2 content_type
|
||||
|
||||
data_type: 'text'
|
||||
is_nullable: 1
|
||||
size: 255
|
||||
size: 256
|
||||
|
||||
=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 },
|
||||
"seaweedfs_fid",
|
||||
{ data_type => "text", is_nullable => 0, size => 33 },
|
||||
"filename",
|
||||
{ data_type => "text", is_nullable => 0, size => 255 },
|
||||
{ data_type => "text", is_nullable => 0, size => 256 },
|
||||
"content_type",
|
||||
{ data_type => "text", is_nullable => 1, size => 255 },
|
||||
{ data_type => "text", is_nullable => 1, size => 256 },
|
||||
);
|
||||
|
||||
=head1 PRIMARY KEY
|
||||
|
@ -100,8 +100,8 @@ Composing rels: L</media_tags> -> tag
|
|||
__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
|
||||
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-03-04 20:47:27
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:E7eWNfGOqqI1Kub7Vv/WHQ
|
||||
|
||||
|
||||
# You can replace this text with custom code or comments, and it will be preserved on regeneration
|
||||
|
|
|
@ -33,7 +33,7 @@ __PACKAGE__->table("tags");
|
|||
|
||||
data_type: 'text'
|
||||
is_nullable: 0
|
||||
size: 255
|
||||
size: 256
|
||||
|
||||
=cut
|
||||
|
||||
|
@ -41,7 +41,7 @@ __PACKAGE__->add_columns(
|
|||
"tag_id",
|
||||
{ data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
|
||||
"name",
|
||||
{ data_type => "text", is_nullable => 0, size => 255 },
|
||||
{ data_type => "text", is_nullable => 0, size => 256 },
|
||||
);
|
||||
|
||||
=head1 PRIMARY KEY
|
||||
|
@ -98,8 +98,8 @@ Composing rels: L</media_tags> -> media
|
|||
__PACKAGE__->many_to_many("medias", "media_tags", "media");
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-02-18 09:09:31
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:tlbIFVg6S6LAWWiR0ioHFw
|
||||
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-03-04 20:04:03
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:d5XP9DAiUTQzW1+c3qph4w
|
||||
|
||||
|
||||
# You can replace this text with custom code or comments, and it will be preserved on regeneration
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
use utf8;
|
||||
package PoorBooru::Schema::Result::TagsCountView;
|
||||
package PoorBooru::Schema::Result::TagCountView;
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader
|
||||
# DO NOT MODIFY THE FIRST PART OF THIS FILE
|
||||
|
||||
=head1 NAME
|
||||
|
||||
PoorBooru::Schema::Result::TagsCountView
|
||||
PoorBooru::Schema::Result::TagCountView
|
||||
|
||||
=cut
|
||||
|
||||
|
@ -16,11 +16,11 @@ use warnings;
|
|||
use base 'DBIx::Class::Core';
|
||||
__PACKAGE__->table_class("DBIx::Class::ResultSource::View");
|
||||
|
||||
=head1 TABLE: C<tags_count_view>
|
||||
=head1 TABLE: C<tag_count_view>
|
||||
|
||||
=cut
|
||||
|
||||
__PACKAGE__->table("tags_count_view");
|
||||
__PACKAGE__->table("tag_count_view");
|
||||
|
||||
=head1 ACCESSORS
|
||||
|
||||
|
@ -33,7 +33,7 @@ __PACKAGE__->table("tags_count_view");
|
|||
|
||||
data_type: 'text'
|
||||
is_nullable: 1
|
||||
size: 255
|
||||
size: 256
|
||||
|
||||
=head2 count
|
||||
|
||||
|
@ -46,14 +46,14 @@ __PACKAGE__->add_columns(
|
|||
"tag_id",
|
||||
{ data_type => "integer", is_nullable => 1 },
|
||||
"name",
|
||||
{ data_type => "text", is_nullable => 1, size => 255 },
|
||||
{ data_type => "text", is_nullable => 1, size => 256 },
|
||||
"count",
|
||||
{ data_type => "", is_nullable => 1 },
|
||||
);
|
||||
|
||||
|
||||
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-02-18 09:09:31
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:9NUzqweyXVu/G84fxb3eew
|
||||
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2023-03-04 20:01:07
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:SbewAyRFuSCJXVLv6b5y0g
|
||||
|
||||
|
||||
# You can replace this text with custom code or comments, and it will be preserved on regeneration
|
Reference in a new issue