eventcally/migrations/versions/92f37474ad62_.py
Daniel Grams d63f340384 Internal/modules (#1)
* Restructured app
* Added Travis CI
* Added 'Deploy to heroku' button
2020-11-13 12:24:26 +01:00

48 lines
2.0 KiB
Python

"""empty message
Revision ID: 92f37474ad62
Revises: 0a282a331e35
Create Date: 2020-10-18 13:06:47.639083
"""
from alembic import op
import sqlalchemy as sa
import sqlalchemy_utils
from project import dbtypes
from project.models import EventRejectionReason, EventReviewStatus
# revision identifiers, used by Alembic.
revision = '92f37474ad62'
down_revision = '0a282a331e35'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
#op.drop_table('spatial_ref_sys')
op.drop_constraint('eventplace_name_organizer_id_admin_unit_id_key', 'eventplace', type_='unique')
op.drop_constraint('eventplace_organizer_id_fkey', 'eventplace', type_='foreignkey')
op.drop_column('eventplace', 'public')
op.drop_column('eventplace', 'organizer_id')
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('eventplace', sa.Column('organizer_id', sa.INTEGER(), autoincrement=False, nullable=True))
op.add_column('eventplace', sa.Column('public', sa.BOOLEAN(), autoincrement=False, nullable=True))
op.create_foreign_key('eventplace_organizer_id_fkey', 'eventplace', 'eventorganizer', ['organizer_id'], ['id'])
op.create_unique_constraint('eventplace_name_organizer_id_admin_unit_id_key', 'eventplace', ['name', 'organizer_id', 'admin_unit_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 ###