"""test_variations

Revision ID: 23ed581b6dc
Revises: 1c3eba8b7b0
Create Date: 2015-12-07 14:24:47.641345

"""

# revision identifiers, used by Alembic.
revision = '23ed581b6dc'
down_revision = '1c3eba8b7b0'

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

def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('test_variation',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('variation', postgresql.JSONB(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.add_column('test', sa.Column('test_variation_id', sa.Integer(), nullable=True))
    op.create_index(op.f('ix_test_test_variation_id'), 'test', ['test_variation_id'], unique=False)
    op.create_foreign_key(None, 'test', 'test_variation', ['test_variation_id'], ['id'], ondelete='CASCADE')
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(None, 'test', type_='foreignkey')
    op.drop_index(op.f('ix_test_test_variation_id'), table_name='test')
    op.drop_column('test', 'test_variation_id')
    op.drop_table('test_variation')
    ### end Alembic commands ###
