Make byte_count on BlobUpload table not nullable
The byte_count field on the BlobUpload model is marked as not
nullable, but the migration to make the field a big integer removed
that restriction (#2388 :: 76de324
) in the database. It's still in
the model though, which means they are out of sync. This adds a
migration to mark the field as not nullable in the database again.
This commit is contained in:
parent
f458307ffd
commit
f89a16a64d
2 changed files with 24 additions and 0 deletions
|
@ -0,0 +1,24 @@
|
||||||
|
"""Make BlodUpload byte_count not nullable
|
||||||
|
|
||||||
|
Revision ID: 152edccba18c
|
||||||
|
Revises: c91c564aad34
|
||||||
|
Create Date: 2018-02-23 12:41:25.571835
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
# revision identifiers, used by Alembic.
|
||||||
|
revision = '152edccba18c'
|
||||||
|
down_revision = 'c91c564aad34'
|
||||||
|
|
||||||
|
from alembic import op
|
||||||
|
import sqlalchemy as sa
|
||||||
|
|
||||||
|
|
||||||
|
def upgrade(tables):
|
||||||
|
op.alter_column('blobupload', 'byte_count', existing_type=sa.BigInteger(),
|
||||||
|
nullable=False)
|
||||||
|
|
||||||
|
|
||||||
|
def downgrade(tables):
|
||||||
|
op.alter_column('blobupload', 'byte_count', existing_type=sa.BigInteger(),
|
||||||
|
nullable=True)
|
Binary file not shown.
Reference in a new issue