eventcally/migrations/versions/50337ecd23db_.py
Daniel Grams 273b3fb072 Internal/analysis (#4)
* Codestyle Black

* Flake8

* Test coverage
2020-11-13 23:05:39 +01:00

52 lines
1.6 KiB
Python

"""empty message
Revision ID: 50337ecd23db
Revises: 6be822396123
Create Date: 2020-10-27 20:31:42.566357
"""
from alembic import op
import sqlalchemy as sa
import sqlalchemy_utils
from project import dbtypes
# revision identifiers, used by Alembic.
revision = "50337ecd23db"
down_revision = "6be822396123"
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
# op.drop_table('spatial_ref_sys')
op.add_column("eventsuggestion", sa.Column("event_id", sa.Integer(), nullable=True))
op.create_foreign_key(None, "eventsuggestion", "event", ["event_id"], ["id"])
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint(None, "eventsuggestion", type_="foreignkey")
op.drop_column("eventsuggestion", "event_id")
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 ###