"""add soft delete to application and environment resources and roles

Revision ID: 014e4bceb947
Revises: 32438a35cfb5
Create Date: 2019-04-10 09:40:37.688157

"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.sql import expression


# revision identifiers, used by Alembic.
revision = '014e4bceb947'
down_revision = '32438a35cfb5'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('application_roles', sa.Column('deleted', sa.Boolean(), server_default=expression.false(), nullable=False))
    op.add_column('applications', sa.Column('deleted', sa.Boolean(), server_default=expression.false(), nullable=False))
    op.add_column('environment_roles', sa.Column('deleted', sa.Boolean(), server_default=expression.false(), nullable=False))
    op.add_column('environments', sa.Column('deleted', sa.Boolean(), server_default=expression.false(), nullable=False))
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('environments', 'deleted')
    op.drop_column('environment_roles', 'deleted')
    op.drop_column('applications', 'deleted')
    op.drop_column('application_roles', 'deleted')
    # ### end Alembic commands ###
