Skip to content

Commit

Permalink
server: enable large file support in database
Browse files Browse the repository at this point in the history
  • Loading branch information
sgsunder committed Oct 11, 2020
1 parent 143f633 commit a302b2c
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -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
)
2 changes: 1 addition & 1 deletion server/szurubooru/model/post.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a302b2c

Please sign in to comment.