# pylint: disable=no-member
"""export_set field in network and network region

Revision ID: 0716d393ff9d
Revises: 0bd<PASSWORD>
Create Date: 2020-11-17 02:07:16.413677

"""
import sqlalchemy as sa
from alembic import op

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


def upgrade() -> None:
    # network table
    op.add_column("network", sa.Column("export_set", sa.Boolean(), nullable=True))
    op.execute("UPDATE network set export_set=True")
    op.alter_column("network", "export_set", nullable=False)

    # network region table
    op.add_column("network_region", sa.Column("export_set", sa.Boolean(), nullable=True))
    op.execute("UPDATE network_region set export_set=True")
    op.alter_column("network_region", "export_set", nullable=False)


def downgrade() -> None:
    op.drop_column("network_region", "export_set")
    op.drop_column("network", "export_set")

# pylint: disable=no-member
"""export_set field in network and network region

Revision ID: 0716d393ff9d
Revises: 0bd<PASSWORD>
Create Date: 2020-11-17 02:07:16.413677

"""
import sqlalchemy as sa
from alembic import op

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


def upgrade() -> None:
    # network table
    op.add_column("network", sa.Column("export_set", sa.Boolean(), nullable=True))
    op.execute("UPDATE network set export_set=True")
    op.alter_column("network", "export_set", nullable=False)

    # network region table
    op.add_column("network_region", sa.Column("export_set", sa.Boolean(), nullable=True))
    op.execute("UPDATE network_region set export_set=True")
    op.alter_column("network_region", "export_set", nullable=False)


def downgrade() -> None:
    op.drop_column("network_region", "export_set")
    op.drop_column("network", "export_set")

# pylint: disable=no-member export_set field in network and network region  Revision ID: 0716d393ff9d Revises: 0bd<PASSWORD> Create Date: 2020-11-17 02:07:16.413677 # revision identifiers, used by Alembic. # network table # network region table