From a302b2c4a49bf5df082dc5fff799fa9ac8bdfa9f Mon Sep 17 00:00:00 2001 From: Shyam Sunder Date: Sun, 11 Oct 2020 12:50:21 -0400 Subject: [PATCH] server: enable large file support in database --- ...c867abb456b1_support_large_file_uploads.py | 26 +++++++++++++++++++ server/szurubooru/model/post.py | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 server/szurubooru/migrations/versions/c867abb456b1_support_large_file_uploads.py diff --git a/server/szurubooru/migrations/versions/c867abb456b1_support_large_file_uploads.py b/server/szurubooru/migrations/versions/c867abb456b1_support_large_file_uploads.py new file mode 100644 index 0000000..212e196 --- /dev/null +++ b/server/szurubooru/migrations/versions/c867abb456b1_support_large_file_uploads.py @@ -0,0 +1,26 @@ +""" +support large file uploads + +Revision ID: c867abb456b1 +Created at: 2020-10-11 15:37:30.965231 +""" + +import sqlalchemy as sa +from alembic import op + +revision = "c867abb456b1" +down_revision = "c97dc1bf184a" +branch_labels = None +depends_on = None + + +def upgrade(): + op.alter_column( + "post", "file_size", type_=sa.BigInteger, existing_type=sa.Integer + ) + + +def downgrade(): + op.alter_column( + "post", "file_size", type_=sa.Integer, existing_type=sa.BigInteger + ) diff --git a/server/szurubooru/model/post.py b/server/szurubooru/model/post.py index 9e06a74..d6cf77e 100644 --- a/server/szurubooru/model/post.py +++ b/server/szurubooru/model/post.py @@ -217,7 +217,7 @@ class Post(Base): # content description type = sa.Column("type", sa.Unicode(32), nullable=False) checksum = sa.Column("checksum", sa.Unicode(64), nullable=False) - file_size = sa.Column("file_size", sa.Integer) + file_size = sa.Column("file_size", sa.BigInteger) canvas_width = sa.Column("image_width", sa.Integer) canvas_height = sa.Column("image_height", sa.Integer) mime_type = sa.Column("mime-type", sa.Unicode(32), nullable=False)