diff options
| author | Shyam Sunder | 2020-10-11 12:50:21 -0400 |
|---|---|---|
| committer | Shyam Sunder | 2020-10-11 12:50:21 -0400 |
| commit | a302b2c4a49bf5df082dc5fff799fa9ac8bdfa9f (patch) | |
| tree | d606db241b416b78c41fdb1492914c75acc70de1 /server/szurubooru | |
| parent | 143f633eaac6b762bcae7877d98fec5e2f1a994c (diff) | |
server: enable large file support in database
Diffstat (limited to 'server/szurubooru')
| -rw-r--r-- | server/szurubooru/migrations/versions/c867abb456b1_support_large_file_uploads.py | 26 | ||||
| -rw-r--r-- | server/szurubooru/model/post.py | 2 |
2 files changed, 27 insertions, 1 deletions
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) |