"""add entity annotions

Revision ID: 6c7b56b35fa5
Revises: <PASSWORD>
Create Date: 2019-11-14 10:53:29.331271

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '6c7b56b35fa5'
down_revision = 'ad<PASSWORD>'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('annotation', sa.Column('map_interaction_id', sa.Integer(), nullable=True))
    op.add_column('annotation', sa.Column('map_search_id', sa.Integer(), nullable=True))
    op.add_column('annotation', sa.Column('routing_id', sa.Integer(), nullable=True))
    op.add_column('annotation', sa.Column('spatial_bookmark_id', sa.Integer(), nullable=True))
    op.add_column('annotation', sa.Column('user_position_id', sa.Integer(), nullable=True))
    op.create_foreign_key('fkey_annotation_map_interaction', 'annotation', 'map_interaction', ['map_interaction_id'], ['id'])
    op.create_foreign_key('fkey_annotation_spatial_bookmark', 'annotation', 'spatial_bookmark', ['spatial_bookmark_id'], ['id'])
    op.create_foreign_key('fkey_annotation_map_search', 'annotation', 'map_search', ['map_search_id'], ['id'])
    op.create_foreign_key('fkey_annotation_user_position', 'annotation', 'user_position', ['user_position_id'], ['id'])
    op.create_foreign_key('fkey_annotation_routing', 'annotation', 'routing', ['routing_id'], ['id'])
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint('fkey_annotation_map_interaction', 'annotation', type_='foreignkey')
    op.drop_constraint('fkey_annotation_spatial_bookmark', 'annotation', type_='foreignkey')
    op.drop_constraint('fkey_annotation_map_search', 'annotation', type_='foreignkey')
    op.drop_constraint('fkey_annotation_user_position', 'annotation', type_='foreignkey')
    op.drop_constraint('fkey_annotation_routing', 'annotation', type_='foreignkey')
    op.drop_column('annotation', 'user_position_id')
    op.drop_column('annotation', 'spatial_bookmark_id')
    op.drop_column('annotation', 'routing_id')
    op.drop_column('annotation', 'map_search_id')
    op.drop_column('annotation', 'map_interaction_id')
    # ### end Alembic commands ###

"""add entity annotions

Revision ID: 6c7b56b35fa5
Revises: <PASSWORD>
Create Date: 2019-11-14 10:53:29.331271

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '6c7b56b35fa5'
down_revision = 'ad<PASSWORD>'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('annotation', sa.Column('map_interaction_id', sa.Integer(), nullable=True))
    op.add_column('annotation', sa.Column('map_search_id', sa.Integer(), nullable=True))
    op.add_column('annotation', sa.Column('routing_id', sa.Integer(), nullable=True))
    op.add_column('annotation', sa.Column('spatial_bookmark_id', sa.Integer(), nullable=True))
    op.add_column('annotation', sa.Column('user_position_id', sa.Integer(), nullable=True))
    op.create_foreign_key('fkey_annotation_map_interaction', 'annotation', 'map_interaction', ['map_interaction_id'], ['id'])
    op.create_foreign_key('fkey_annotation_spatial_bookmark', 'annotation', 'spatial_bookmark', ['spatial_bookmark_id'], ['id'])
    op.create_foreign_key('fkey_annotation_map_search', 'annotation', 'map_search', ['map_search_id'], ['id'])
    op.create_foreign_key('fkey_annotation_user_position', 'annotation', 'user_position', ['user_position_id'], ['id'])
    op.create_foreign_key('fkey_annotation_routing', 'annotation', 'routing', ['routing_id'], ['id'])
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint('fkey_annotation_map_interaction', 'annotation', type_='foreignkey')
    op.drop_constraint('fkey_annotation_spatial_bookmark', 'annotation', type_='foreignkey')
    op.drop_constraint('fkey_annotation_map_search', 'annotation', type_='foreignkey')
    op.drop_constraint('fkey_annotation_user_position', 'annotation', type_='foreignkey')
    op.drop_constraint('fkey_annotation_routing', 'annotation', type_='foreignkey')
    op.drop_column('annotation', 'user_position_id')
    op.drop_column('annotation', 'spatial_bookmark_id')
    op.drop_column('annotation', 'routing_id')
    op.drop_column('annotation', 'map_search_id')
    op.drop_column('annotation', 'map_interaction_id')
    # ### end Alembic commands ###

add entity annotions  Revision ID: 6c7b56b35fa5 Revises: <PASSWORD> Create Date: 2019-11-14 10:53:29.331271 # revision identifiers, used by Alembic. # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic commands ### # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic commands ###