"""empty message

Revision ID: 0a282a331e35
Revises: da63ba1d58b1
Create Date: 2020-10-18 11:55:12.315808

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

from project import dbtypes

# revision identifiers, used by Alembic.
revision = "0a282a331e35"
down_revision = "da63ba1d58b1"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    # op.drop_table('spatial_ref_sys')
    op.add_column("event", sa.Column("booked_up", sa.Boolean(), nullable=True))
    op.add_column(
        "event", sa.Column("expected_participants", sa.Integer(), nullable=True)
    )
    op.add_column("event", sa.Column("price_info", sa.UnicodeText(), nullable=True))
    op.add_column(
        "event", sa.Column("registration_required", sa.Boolean(), nullable=True)
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column("event", "registration_required")
    op.drop_column("event", "price_info")
    op.drop_column("event", "expected_participants")
    op.drop_column("event", "booked_up")
    op.create_table(
        "spatial_ref_sys",
        sa.Column("srid", sa.INTEGER(), autoincrement=False, nullable=False),
        sa.Column(
            "auth_name", sa.VARCHAR(length=256), autoincrement=False, nullable=True
        ),
        sa.Column("auth_srid", sa.INTEGER(), autoincrement=False, nullable=True),
        sa.Column(
            "srtext", sa.VARCHAR(length=2048), autoincrement=False, nullable=True
        ),
        sa.Column(
            "proj4text", sa.VARCHAR(length=2048), autoincrement=False, nullable=True
        ),
        sa.CheckConstraint(
            "(srid > 0) AND (srid <= 998999)", name="spatial_ref_sys_srid_check"
        ),
        sa.PrimaryKeyConstraint("srid", name="spatial_ref_sys_pkey"),
    )
    # ### end Alembic commands ###
