"""0003

Revision ID: 0003
Revises: 0002
Create Date: 2017-06-23 15:41:02.271266

"""

# revision identifiers, used by Alembic.
revision = '0003'
down_revision = '0002'
branch_labels = None
depends_on = None

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

def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('rfid_event', schema=None) as batch_op:
        batch_op.create_index('idx_rfid_lookup', ['reader_id', 'rfid', 'last_detected_at'], unique=False)
        batch_op.drop_index('ix_rfid_event_last_detected_at')
        batch_op.drop_index('ix_rfid_event_rfid')

    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('rfid_event', schema=None) as batch_op:
        batch_op.create_index('ix_rfid_event_rfid', ['rfid'], unique=False)
        batch_op.create_index('ix_rfid_event_last_detected_at', ['last_detected_at'], unique=False)
        batch_op.drop_index('idx_rfid_lookup')
    # ### end Alembic commands ###
