<reponame>dshushin/knwldgbs
"""environment added

Revision ID: db3f22905a81
Revises: <KEY>
Create Date: 2020-04-11 21:12:53.515865

"""
from alembic import op
import sqlalchemy as sa


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


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('document', 'status')
    op.add_column('tags', sa.Column('env_id', sa.Integer(), nullable=False))
    op.create_unique_constraint(None, 'tags', ['path'])
    op.create_foreign_key(None, 'tags', 'environment', ['env_id'], ['id'])
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(None, 'tags', type_='foreignkey')
    op.drop_constraint(None, 'tags', type_='unique')
    op.drop_column('tags', 'env_id')
    op.add_column('document', sa.Column('status', sa.VARCHAR(length=256), autoincrement=False, nullable=True))
    # ### end Alembic commands ###

"""environment added

Revision ID: db3f22905a81
Revises: <KEY>
Create Date: 2020-04-11 21:12:53.515865

"""
from alembic import op
import sqlalchemy as sa


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


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('document', 'status')
    op.add_column('tags', sa.Column('env_id', sa.Integer(), nullable=False))
    op.create_unique_constraint(None, 'tags', ['path'])
    op.create_foreign_key(None, 'tags', 'environment', ['env_id'], ['id'])
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(None, 'tags', type_='foreignkey')
    op.drop_constraint(None, 'tags', type_='unique')
    op.drop_column('tags', 'env_id')
    op.add_column('document', sa.Column('status', sa.VARCHAR(length=256), autoincrement=False, nullable=True))
    # ### end Alembic commands ###
environment added  Revision ID: db3f22905a81 Revises: <KEY> Create Date: 2020-04-11 21:12:53.515865 # revision identifiers, used by Alembic. # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic commands ### # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic commands ###