"""Add mapped_variants table

Revision ID: 33e99d4b90cc
Revises: 988ca84c701b
Create Date: 2023-05-15 17:24:07.847206

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

# revision identifiers, used by Alembic.
revision = '33e99d4b90cc'
down_revision = 'da9ba478647d'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('mapped_variants',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('pre_mapped', postgresql.JSONB(astext_type=sa.Text()), nullable=False),
    sa.Column('post_mapped', postgresql.JSONB(astext_type=sa.Text()), nullable=False),
    sa.Column('variant_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['variant_id'], ['variants.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_mapped_variants_id'), 'mapped_variants', ['id'], unique=False)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_mapped_variants_id'), table_name='mapped_variants')
    op.drop_table('mapped_variants')
    # ### end Alembic commands ###
