<gh_stars>1-10
"""Convert synced column to string and add max_height column in blockchain_state_events

Revision ID: ec38afa35b3f
Revises: <KEY>
Create Date: 2021-07-23 11:23:03.058140

"""
import sqlalchemy as sa
from alembic import op


# revision identifiers, used by Alembic.
revision = 'ec38afa35b3f'
down_revision = '<KEY>'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('blockchain_state_events', schema=None) as batch_op:
        batch_op.add_column(sa.Column('max_height', sa.String(length=32), nullable=True))
        batch_op.alter_column('synced',
               existing_type=sa.BOOLEAN(),
               type_=sa.String(length=32),
               existing_nullable=True)

    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('blockchain_state_events', schema=None) as batch_op:
        batch_op.alter_column('synced',
               existing_type=sa.String(length=32),
               type_=sa.BOOLEAN(),
               existing_nullable=True)
        batch_op.drop_column('max_height')

    # ### end Alembic commands ###

"""Convert synced column to string and add max_height column in blockchain_state_events

Revision ID: ec38afa35b3f
Revises: <KEY>
Create Date: 2021-07-23 11:23:03.058140

"""
import sqlalchemy as sa
from alembic import op


# revision identifiers, used by Alembic.
revision = 'ec38afa35b3f'
down_revision = '<KEY>'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('blockchain_state_events', schema=None) as batch_op:
        batch_op.add_column(sa.Column('max_height', sa.String(length=32), nullable=True))
        batch_op.alter_column('synced',
               existing_type=sa.BOOLEAN(),
               type_=sa.String(length=32),
               existing_nullable=True)

    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('blockchain_state_events', schema=None) as batch_op:
        batch_op.alter_column('synced',
               existing_type=sa.String(length=32),
               type_=sa.BOOLEAN(),
               existing_nullable=True)
        batch_op.drop_column('max_height')

    # ### end Alembic commands ###
Convert synced column to string and add max_height column in blockchain_state_events  Revision ID: ec38afa35b3f Revises: <KEY> Create Date: 2021-07-23 11:23:03.058140 # revision identifiers, used by Alembic. # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic commands ### # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic commands ###