"""empty message

Revision ID: e33f225323f3
Revises: 7b105c6e08bf
Create Date: 2020-12-30 17:59:47.917389

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

from project import dbtypes

# revision identifiers, used by Alembic.
revision = "e33f225323f3"
down_revision = "7b105c6e08bf"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column("adminunit", sa.Column("updated_at", sa.DateTime(), nullable=True))
    op.add_column("adminunit", sa.Column("updated_by_id", sa.Integer(), nullable=True))
    op.create_foreign_key(None, "adminunit", "user", ["updated_by_id"], ["id"])
    op.add_column("event", sa.Column("updated_at", sa.DateTime(), nullable=True))
    op.add_column("event", sa.Column("updated_by_id", sa.Integer(), nullable=True))
    op.create_foreign_key(None, "event", "user", ["updated_by_id"], ["id"])
    op.add_column(
        "eventorganizer", sa.Column("updated_at", sa.DateTime(), nullable=True)
    )
    op.add_column(
        "eventorganizer", sa.Column("updated_by_id", sa.Integer(), nullable=True)
    )
    op.create_foreign_key(None, "eventorganizer", "user", ["updated_by_id"], ["id"])
    op.add_column("eventplace", sa.Column("updated_at", sa.DateTime(), nullable=True))
    op.add_column("eventplace", sa.Column("updated_by_id", sa.Integer(), nullable=True))
    op.create_foreign_key(None, "eventplace", "user", ["updated_by_id"], ["id"])
    op.add_column(
        "eventreference", sa.Column("updated_at", sa.DateTime(), nullable=True)
    )
    op.add_column(
        "eventreference", sa.Column("updated_by_id", sa.Integer(), nullable=True)
    )
    op.create_foreign_key(None, "eventreference", "user", ["updated_by_id"], ["id"])
    op.add_column(
        "eventreferencerequest", sa.Column("updated_at", sa.DateTime(), nullable=True)
    )
    op.add_column(
        "eventreferencerequest", sa.Column("updated_by_id", sa.Integer(), nullable=True)
    )
    op.create_foreign_key(
        None, "eventreferencerequest", "user", ["updated_by_id"], ["id"]
    )
    op.add_column(
        "eventsuggestion", sa.Column("updated_at", sa.DateTime(), nullable=True)
    )
    op.add_column(
        "eventsuggestion", sa.Column("updated_by_id", sa.Integer(), nullable=True)
    )
    op.create_foreign_key(None, "eventsuggestion", "user", ["updated_by_id"], ["id"])
    op.add_column("image", sa.Column("updated_at", sa.DateTime(), nullable=True))
    op.add_column("image", sa.Column("updated_by_id", sa.Integer(), nullable=True))
    op.create_foreign_key(None, "image", "user", ["updated_by_id"], ["id"])
    op.add_column("location", sa.Column("updated_at", sa.DateTime(), nullable=True))
    op.add_column("location", sa.Column("updated_by_id", sa.Integer(), nullable=True))
    op.create_foreign_key(None, "location", "user", ["updated_by_id"], ["id"])
    op.add_column("settings", sa.Column("updated_at", sa.DateTime(), nullable=True))
    op.add_column("settings", sa.Column("updated_by_id", sa.Integer(), nullable=True))
    op.create_foreign_key(None, "settings", "user", ["updated_by_id"], ["id"])
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(None, "settings", type_="foreignkey")
    op.drop_column("settings", "updated_by_id")
    op.drop_column("settings", "updated_at")
    op.drop_constraint(None, "location", type_="foreignkey")
    op.drop_column("location", "updated_by_id")
    op.drop_column("location", "updated_at")
    op.drop_constraint(None, "image", type_="foreignkey")
    op.drop_column("image", "updated_by_id")
    op.drop_column("image", "updated_at")
    op.drop_constraint(None, "eventsuggestion", type_="foreignkey")
    op.drop_column("eventsuggestion", "updated_by_id")
    op.drop_column("eventsuggestion", "updated_at")
    op.drop_constraint(None, "eventreferencerequest", type_="foreignkey")
    op.drop_column("eventreferencerequest", "updated_by_id")
    op.drop_column("eventreferencerequest", "updated_at")
    op.drop_constraint(None, "eventreference", type_="foreignkey")
    op.drop_column("eventreference", "updated_by_id")
    op.drop_column("eventreference", "updated_at")
    op.drop_constraint(None, "eventplace", type_="foreignkey")
    op.drop_column("eventplace", "updated_by_id")
    op.drop_column("eventplace", "updated_at")
    op.drop_constraint(None, "eventorganizer", type_="foreignkey")
    op.drop_column("eventorganizer", "updated_by_id")
    op.drop_column("eventorganizer", "updated_at")
    op.drop_constraint(None, "event", type_="foreignkey")
    op.drop_column("event", "updated_by_id")
    op.drop_column("event", "updated_at")
    op.drop_constraint(None, "adminunit", type_="foreignkey")
    op.drop_column("adminunit", "updated_by_id")
    op.drop_column("adminunit", "updated_at")
    # ### end Alembic commands ###
