"""category migration

Revision ID: d06b1fe226da
Revises: 
Create Date: 2019-07-01 08:28:36.367890

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'd06b1fe226da'
down_revision = None
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('category')
    op.add_column('pitch', sa.Column('pitch_category', sa.String(), nullable=True))
    op.drop_constraint('pitch_category_id_fkey', 'pitch', type_='foreignkey')
    op.drop_column('pitch', 'category_id')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('pitch', sa.Column('category_id', sa.INTEGER(), autoincrement=False, nullable=True))
    op.create_foreign_key('pitch_category_id_fkey', 'pitch', 'category', ['category_id'], ['id'])
    op.drop_column('pitch', 'pitch_category')
    op.create_table('category',
    sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False),
    sa.Column('category', sa.VARCHAR(length=255), autoincrement=False, nullable=True),
    sa.PrimaryKeyConstraint('id', name='category_pkey')
    )
    # ### end Alembic commands ###
