Add migration for properly creating the repository_id+datetime index

This commit is contained in:
Joseph Schorr 2015-04-19 16:03:06 -04:00
parent e56d5a9fe5
commit ed342ae831

View file

@ -0,0 +1,26 @@
"""add index for repository+datetime to logentry
Revision ID: 67eb43c778b
Revises: 1c3decf6b9c4
Create Date: 2015-04-19 16:00:39.126289
"""
# revision identifiers, used by Alembic.
revision = '67eb43c778b'
down_revision = '1c3decf6b9c4'
from alembic import op
import sqlalchemy as sa
def upgrade(tables):
### commands auto generated by Alembic - please adjust! ###
op.create_index('logentry_repository_id_datetime', 'logentry', ['repository_id', 'datetime'], unique=False)
### end Alembic commands ###
def downgrade(tables):
### commands auto generated by Alembic - please adjust! ###
op.drop_index('logentry_repository_id_datetime', table_name='logentry')
### end Alembic commands ###