"""empty message

Revision ID: 49c68df13fca
Revises: 51239a6a31d9
Create Date: 2020-01-20 14:15:54.845279

"""
import sqlalchemy as sa
from alembic import op

# revision identifiers, used by Alembic.
revision = "49c68df13fca"
down_revision = "51239a6a31d9"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column(
        "orders", sa.Column("parent_order_id", sa.BigInteger(), nullable=True)
    )
    op.create_foreign_key(
        op.f("fk_orders_parent_order_id_orders"),
        "orders",
        "orders",
        ["parent_order_id"],
        ["id"],
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(
        op.f("fk_orders_parent_order_id_orders"), "orders", type_="foreignkey"
    )
    op.drop_column("orders", "parent_order_id")
    # ### end Alembic commands ###
