Add migration for properly creating the repository_id+datetime index
This commit is contained in:
parent
e56d5a9fe5
commit
ed342ae831
1 changed files with 26 additions and 0 deletions
|
@ -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 ###
|
Reference in a new issue