"""prevent_org_deletion

Revision: 0189
Revision ID: 5bcdd81f9309
Revises: 68d34c581b25
Create Date: 2020-08-14 09:23:35.452231

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


# revision identifiers, used by Alembic.
revision = '5bcdd81f9309'
down_revision = '68d34c581b25'
branch_labels = None
depends_on = None


def upgrade():
    op.add_column('organizations', sa.Column('prevent_deletion', sa.Boolean(), nullable=True))
    op.execute("UPDATE organizations SET prevent_deletion=false")


def downgrade():
    op.drop_column('organizations', 'prevent_deletion')
