mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 19:01:39 -04:00
Increasing file size column to bigint to allow for larger files.
This commit is contained in:
parent
172e45f479
commit
d617c88343
2 changed files with 31 additions and 1 deletions
30
alembic/versions/aac864072193_increase_file_size_column.py
Normal file
30
alembic/versions/aac864072193_increase_file_size_column.py
Normal 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
|
||||
|
|
@ -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())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue