From deb082f46c1252950950723655ad42e56e97f532 Mon Sep 17 00:00:00 2001 From: Lucas Date: Sat, 18 Feb 2023 17:06:00 +0000 Subject: [PATCH] db: add upload_date field to media table --- bin/create-dbix-class-schemas | 3 ++- lib/PoorBooru/Schema/Result/Media.pm | 11 +++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/bin/create-dbix-class-schemas b/bin/create-dbix-class-schemas index d04d9b3..0f4faf1 100755 --- a/bin/create-dbix-class-schemas +++ b/bin/create-dbix-class-schemas @@ -33,7 +33,8 @@ CREATE TABLE IF NOT EXISTS media( media_id INTEGER PRIMARY KEY, content BLOB (10485760) NOT NULL, filename TEXT (255) NOT NULL, - content_type TEXT (255) + content_type TEXT (255), + upload_date INTEGER ); CREATE TABLE IF NOT EXISTS tags( diff --git a/lib/PoorBooru/Schema/Result/Media.pm b/lib/PoorBooru/Schema/Result/Media.pm index 94c7a02..a355ab1 100644 --- a/lib/PoorBooru/Schema/Result/Media.pm +++ b/lib/PoorBooru/Schema/Result/Media.pm @@ -47,6 +47,11 @@ __PACKAGE__->table("media"); is_nullable: 1 size: 255 +=head2 upload_date + + data_type: 'integer' + is_nullable: 1 + =cut __PACKAGE__->add_columns( @@ -58,6 +63,8 @@ __PACKAGE__->add_columns( { data_type => "text", is_nullable => 0, size => 255 }, "content_type", { data_type => "text", is_nullable => 1, size => 255 }, + "upload_date", + { data_type => "integer", is_nullable => 1 }, ); =head1 PRIMARY KEY @@ -100,8 +107,8 @@ Composing rels: L -> 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-02-18 16:42:33 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:161J2QWJ+cTNXlIdiUBPEw # You can replace this text with custom code or comments, and it will be preserved on regeneration