<gh_stars>0
"""raceresult.runnerid index; location table

Revision ID: <KEY>
Revises: <PASSWORD>
Create Date: 2016-11-18 11:54:34.919000

"""

# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = '7d3595961ca1'

from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql

def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('location',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=64), nullable=True),
    sa.Column('latitude', sa.Float(), nullable=True),
    sa.Column('longitude', sa.Float(), nullable=True),
    sa.Column('cached_at', sa.DateTime(), nullable=True),
    sa.Column('lookuperror', sa.Boolean(), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('name')
    )
    op.add_column('club', sa.Column('location', sa.String(length=64), nullable=True))
    op.add_column('race', sa.Column('locationid', sa.Integer(), nullable=True))
    op.create_foreign_key(None, 'race', 'location', ['locationid'], ['id'])
    op.drop_column('race', 'location')
    op.create_index(op.f('ix_raceresult_runnerid'), 'raceresult', ['runnerid'], unique=False)
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_raceresult_runnerid'), table_name='raceresult')
    op.add_column('race', sa.Column('location', mysql.VARCHAR(length=64), nullable=True))
    op.drop_constraint(None, 'race', type_='foreignkey')
    op.drop_column('race', 'locationid')
    op.drop_column('club', 'location')
    op.drop_table('location')
    ### end Alembic commands ###

"""raceresult.runnerid index; location table

Revision ID: <KEY>
Revises: <PASSWORD>
Create Date: 2016-11-18 11:54:34.919000

"""

# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = '7d3595961ca1'

from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql

def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('location',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=64), nullable=True),
    sa.Column('latitude', sa.Float(), nullable=True),
    sa.Column('longitude', sa.Float(), nullable=True),
    sa.Column('cached_at', sa.DateTime(), nullable=True),
    sa.Column('lookuperror', sa.Boolean(), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('name')
    )
    op.add_column('club', sa.Column('location', sa.String(length=64), nullable=True))
    op.add_column('race', sa.Column('locationid', sa.Integer(), nullable=True))
    op.create_foreign_key(None, 'race', 'location', ['locationid'], ['id'])
    op.drop_column('race', 'location')
    op.create_index(op.f('ix_raceresult_runnerid'), 'raceresult', ['runnerid'], unique=False)
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_raceresult_runnerid'), table_name='raceresult')
    op.add_column('race', sa.Column('location', mysql.VARCHAR(length=64), nullable=True))
    op.drop_constraint(None, 'race', type_='foreignkey')
    op.drop_column('race', 'locationid')
    op.drop_column('club', 'location')
    op.drop_table('location')
    ### end Alembic commands ###
raceresult.runnerid index; location table  Revision ID: <KEY> Revises: <PASSWORD> Create Date: 2016-11-18 11:54:34.919000 # 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 ###