"""empty message

Revision ID: 75c07cb9cfe3
Revises: abf0f671ba27
Create Date: 2020-07-07 10:11:08.217831

"""
import sqlalchemy as sa
import sqlalchemy_utils
from alembic import op

# revision identifiers, used by Alembic.
revision = "75c07cb9cfe3"
down_revision = "abf0f671ba27"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column(
        "adminunit", sa.Column("email", sa.Unicode(length=255), nullable=True)
    )
    op.add_column("adminunit", sa.Column("location_id", sa.Integer(), nullable=True))
    op.add_column("adminunit", sa.Column("logo_id", sa.Integer(), nullable=True))
    op.add_column(
        "adminunit", sa.Column("phone", sa.Unicode(length=255), nullable=True)
    )
    op.add_column("adminunit", sa.Column("url", sa.String(length=255), nullable=True))
    op.create_foreign_key(None, "adminunit", "image", ["logo_id"], ["id"])
    op.create_foreign_key(None, "adminunit", "location", ["location_id"], ["id"])
    op.add_column(
        "organization", sa.Column("email", sa.Unicode(length=255), nullable=True)
    )
    op.add_column(
        "organization", sa.Column("phone", sa.Unicode(length=255), nullable=True)
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column("organization", "phone")
    op.drop_column("organization", "email")
    op.drop_constraint(None, "adminunit", type_="foreignkey")
    op.drop_constraint(None, "adminunit", type_="foreignkey")
    op.drop_column("adminunit", "url")
    op.drop_column("adminunit", "phone")
    op.drop_column("adminunit", "logo_id")
    op.drop_column("adminunit", "location_id")
    op.drop_column("adminunit", "email")
    # ### end Alembic commands ###
