<gh_stars>0
"""stack_request_coltype_change.

Revision ID: b19a6deb869d
Revises: 424427<PASSWORD>
Create Date: 2016-10-19 11:24:35.726960

"""

# revision identifiers, used by Alembic.
revision = 'b19a6deb869d'
down_revision = '4<PASSWORD>'
branch_labels = None
depends_on = None

from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql


def upgrade():
    """Upgrade the database to a newer revision."""
    # commands auto generated by Alembic - please adjust! ###
    # op.alter_column('stack_analyses_request', 'requestJson',
    #            existing_type=sa.VARCHAR(length=4096),
    #            type_=postgresql.JSON(astext_type=postgresql.JSON()),
    #            existing_nullable=False)
    op.execute('ALTER TABLE stack_analyses_request ALTER COLUMN "requestJson" TYPE json '
               'using CAST("requestJson" as json)')
    # end Alembic commands ###


def downgrade():
    """Downgrade the database to an older revision."""
    # commands auto generated by Alembic - please adjust! ###
    # op.alter_column('stack_analyses_request', 'requestJson',
    #            existing_type=postgresql.JSON(astext_type=postgresql.JSON()),
    #            type_=sa.VARCHAR(length=4096),
    #            existing_nullable=False)
    op.execute('ALTER TABLE stack_analyses_request ALTER COLUMN "requestJson" TYPE varchar(4098) '
               'using CAST("requestJson" as varchar(4098))')
    # end Alembic commands ###

"""stack_request_coltype_change.

Revision ID: b19a6deb869d
Revises: 424427<PASSWORD>
Create Date: 2016-10-19 11:24:35.726960

"""

# revision identifiers, used by Alembic.
revision = 'b19a6deb869d'
down_revision = '4<PASSWORD>'
branch_labels = None
depends_on = None

from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql


def upgrade():
    """Upgrade the database to a newer revision."""
    # commands auto generated by Alembic - please adjust! ###
    # op.alter_column('stack_analyses_request', 'requestJson',
    #            existing_type=sa.VARCHAR(length=4096),
    #            type_=postgresql.JSON(astext_type=postgresql.JSON()),
    #            existing_nullable=False)
    op.execute('ALTER TABLE stack_analyses_request ALTER COLUMN "requestJson" TYPE json '
               'using CAST("requestJson" as json)')
    # end Alembic commands ###


def downgrade():
    """Downgrade the database to an older revision."""
    # commands auto generated by Alembic - please adjust! ###
    # op.alter_column('stack_analyses_request', 'requestJson',
    #            existing_type=postgresql.JSON(astext_type=postgresql.JSON()),
    #            type_=sa.VARCHAR(length=4096),
    #            existing_nullable=False)
    op.execute('ALTER TABLE stack_analyses_request ALTER COLUMN "requestJson" TYPE varchar(4098) '
               'using CAST("requestJson" as varchar(4098))')
    # end Alembic commands ###
stack_request_coltype_change.  Revision ID: b19a6deb869d Revises: 424427<PASSWORD> Create Date: 2016-10-19 11:24:35.726960 # revision identifiers, used by Alembic. Upgrade the database to a newer revision. # commands auto generated by Alembic - please adjust! ### # op.alter_column('stack_analyses_request', 'requestJson', #            existing_type=sa.VARCHAR(length=4096), #            type_=postgresql.JSON(astext_type=postgresql.JSON()), #            existing_nullable=False) # end Alembic commands ### Downgrade the database to an older revision. # commands auto generated by Alembic - please adjust! ### # op.alter_column('stack_analyses_request', 'requestJson', #            existing_type=postgresql.JSON(astext_type=postgresql.JSON()), #            type_=sa.VARCHAR(length=4096), #            existing_nullable=False) # end Alembic commands ###