migrations/versions/8a3b434d8265_.py
"""empty message
Revision ID: 8a3b434d8265
Revises: d563f6eba95a
Create Date: 2016-06-11 14:12:41.416951
"""
# revision identifiers, used by Alembic.
revision = '8a3b434d8265'
down_revision = 'd563f6eba95a'
from alembic import op
import sqlalchemy as sa
import sqlalchemy_utils
def upgrade():
### commands auto generated by Alembic - please adjust! ###
op.create_table('sponsor_type',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('name', sa.String(), nullable=False),
sa.Column('event_id', sa.Integer(), nullable=True),
sa.ForeignKeyConstraint(['event_id'], ['events.id'], ),
sa.PrimaryKeyConstraint('id')
)
op.add_column(u'sponsors', sa.Column('description', sa.String(), nullable=True))
op.add_column(u'sponsors', sa.Column('sponsor_type_id', sa.Integer(), nullable=True))
op.create_foreign_key(None, 'sponsors', 'sponsor_type', ['sponsor_type_id'], ['id'])
op.add_column(u'tracks', sa.Column('location', sa.String(), nullable=True))
### end Alembic commands ###
def downgrade():
### commands auto generated by Alembic - please adjust! ###
op.drop_column(u'tracks', 'location')
op.drop_constraint(None, 'sponsors', type_='foreignkey')
op.drop_column(u'sponsors', 'sponsor_type_id')
op.drop_column(u'sponsors', 'description')
op.drop_table('sponsor_type')
### end Alembic commands ###