server: enable large file support in database

This commit is contained in:
Shyam Sunder 2020-10-11 12:50:21 -04:00
parent 143f633eaa
commit a302b2c4a4
2 changed files with 27 additions and 1 deletions

View file

@ -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
)

View file

@ -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)