"""views_org_id

Revision: 0207
Revision ID: 0f6cbf29afd9
Revises: 826f4548b733
Create Date: 2020-10-27 09:36:58.128263

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


# revision identifiers, used by Alembic.
revision = '0f6cbf29afd9'
down_revision = '826f4548b733'
branch_labels = None
depends_on = None


def upgrade():
    op.add_column('views', sa.Column('org_id', sa.Integer(), nullable=True))
    op.create_foreign_key(None, 'views', 'organizations', ['org_id'], ['id'], ondelete='CASCADE')

def downgrade():
    op.drop_column('views', 'org_id')
