Migrate the manifest bytes column to UTF8

This commit is contained in:
Joseph Schorr 2018-08-15 11:41:26 -04:00
parent fa58f3b1d2
commit 2b4d52a357
2 changed files with 24 additions and 1 deletions

View file

@ -0,0 +1,23 @@
"""Change manifest_bytes to a UTF8 text field
Revision ID: 654e6df88b71
Revises: eafdeadcebc7
Create Date: 2018-08-15 09:58:46.109277
"""
# revision identifiers, used by Alembic.
revision = '654e6df88b71'
down_revision = 'eafdeadcebc7'
from alembic import op
import sqlalchemy as sa
from util.migrate import UTF8LongText
def upgrade(tables, tester):
op.alter_column('manifest', 'manifest_bytes', existing_type=sa.Text(), type_=UTF8LongText())
def downgrade(tables, tester):
op.alter_column('manifest', 'manifest_bytes', existing_type=UTF8LongText(), type_=sa.Text())

View file

@ -23,6 +23,6 @@ def upgrade(tables, tester):
def downgrade(tables, tester):
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('manifestblob', sa.Column('blob_index', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False))
op.add_column('manifestblob', sa.Column('blob_index', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True))
op.create_index('manifestblob_manifest_id_blob_index', 'manifestblob', ['manifest_id', 'blob_index'], unique=True)
# ### end Alembic commands ###