"""Define relationship between idea and category

Revision ID: a7e021c974c9
Revises: 5fdfecf4aecd
Create Date: 2018-03-18 12:13:03.735441

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'a7e021c974c9'
down_revision = '5fdfecf4aecd'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('tag',
    sa.Column('id', sa.String(), nullable=False),
    sa.Column('idea_tag', sa.Boolean(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.add_column('idea', sa.Column('idea_status', sa.String(), nullable=True))
    op.create_foreign_key(None, 'idea', 'tag', ['idea_status'], ['id'])
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(None, 'idea', type_='foreignkey')
    op.drop_column('idea', 'idea_status')
    op.drop_table('tag')
    # ### end Alembic commands ###
