Increasing file size column to bigint to allow for larger files.

This commit is contained in:
Roland 2022-06-22 17:36:49 -06:00
parent 172e45f479
commit d617c88343
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93
2 changed files with 31 additions and 1 deletions

View file

@ -0,0 +1,30 @@
"""Increase file size column.
Revision ID: aac864072193
Revises: 467235201c70
Create Date: 2022-06-22 17:34:33.635528
"""
import os
from alembic import op
from sqlalchemy.orm import Session
# revision identifiers, used by Alembic.
revision = 'aac864072193'
down_revision = '467235201c70'
branch_labels = None
depends_on = None
DOCKERIZED = True if os.environ.get('DOCKER', '').lower().startswith('t') else False
def upgrade():
bind = op.get_bind()
session = Session(bind=bind)
session.execute('ALTER TABLE file ALTER COLUMN size TYPE bigint')
def downgrade():
pass

View file

@ -120,7 +120,7 @@ def _refresh_files():
logger.info('Refreshing Files')
# Mark all files as unverified. Any records that are unverified after refresh will be deleted.
with get_db_curs(commit=True) as curs:
curs.execute('UPDATE file SET idempotency=null')
curs.execute('UPDATE file SET idempotency=null') # noqa
paths = filter(lambda i: i.is_file(), walk(get_media_directory()))
idempotency = str(uuid4())