<reponame>sagarkaurav/worktable
"""add self many to many relationship

Revision ID: 5096776eb734
Revises: ad6bdb477a50
Create Date: 2021-02-21 11:28:46.212336

"""
import sqlalchemy as sa
from alembic import op

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


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column("projects", sa.Column("project_id", sa.Integer(), nullable=True))
    op.create_foreign_key(
        None, "projects", "projects", ["project_id"], ["id"], ondelete="CASCADE"
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(None, "projects", type_="foreignkey")
    op.drop_column("projects", "project_id")
    # ### end Alembic commands ###
