"""empty message

Revision ID: 61cdca7328a6
Revises: 877d1e12cd90
Create Date: 2016-05-10 17:31:03.793000

"""

# revision identifiers, used by Alembic.
revision = '61cdca7328a6'
down_revision = '877d1e12cd90'

from alembic import op
import sqlalchemy as sa


def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('event_history_types',
    sa.Column('typeID', sa.Integer(), nullable=False),
    sa.Column('typeName', sa.String(length=20), nullable=True),
    sa.PrimaryKeyConstraint('typeID'),
    sa.UniqueConstraint('typeName')
    )
    op.create_table('backseats',
    sa.Column('accountID', sa.Integer(), nullable=True),
    sa.Column('groupID', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['accountID'], ['accounts.id'], ondelete='CASCADE'),
    sa.ForeignKeyConstraint(['groupID'], ['waitlist_groups.groupID'], ondelete='CASCADE')
    )
    op.create_table('event_history_entries',
    sa.Column('historyID', sa.Integer(), nullable=False),
    sa.Column('time', sa.DateTime(), nullable=True),
    sa.Column('typeID', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['typeID'], ['event_history_types.typeID'], ),
    sa.PrimaryKeyConstraint('historyID')
    )
    op.create_index(op.f('ix_event_history_entries_time'), 'event_history_entries', ['time'], unique=False)
    op.create_table('event_history_info',
    sa.Column('infoID', sa.Integer(), nullable=False),
    sa.Column('historyID', sa.Integer(), nullable=True),
    sa.Column('infoType', sa.Integer(), nullable=True),
    sa.Column('referenceID', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['historyID'], ['event_history_entries.historyID'], ),
    sa.PrimaryKeyConstraint('infoID')
    )
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('event_history_info')
    op.drop_index(op.f('ix_event_history_entries_time'), table_name='event_history_entries')
    op.drop_table('event_history_entries')
    op.drop_table('backseats')
    op.drop_table('event_history_types')
    ### end Alembic commands ###
