Add migration to backfill uncompressed image sizes on the storage
This commit is contained in:
parent
1658475ac1
commit
297c8ad29c
2 changed files with 60 additions and 0 deletions
|
@ -0,0 +1,29 @@
|
|||
"""add the uncompressed size to image storage
|
||||
|
||||
Revision ID: 6f2ecf5afcf
|
||||
Revises: 3f6d26399bd2
|
||||
Create Date: 2014-09-22 14:39:13.470566
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '6f2ecf5afcf'
|
||||
down_revision = '3f6d26399bd2'
|
||||
|
||||
from alembic import op
|
||||
from tools.uncompressedsize import backfill_sizes
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
def upgrade(tables):
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('imagestorage', sa.Column('uncompressed_size', sa.BigInteger(), nullable=True))
|
||||
### end Alembic commands ###
|
||||
|
||||
# Backfill the uncompressed size to the image storage table.
|
||||
backfill_sizes()
|
||||
|
||||
def downgrade(tables):
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('imagestorage', 'uncompressed_size')
|
||||
### end Alembic commands ###
|
Reference in a new issue