Skip to content

Commit

Permalink
Add index on valid column of the SQL token Backend
Browse files Browse the repository at this point in the history
Add migration script to add the index

Change-Id: I0d7e231b32040dfb57c2e8023a7f45d65416763c
Fixes: bug #1168399
  • Loading branch information
Sylvain Afchain committed May 29, 2013
1 parent 2879d42 commit 9faf255
Showing 1 changed file with 17 additions and 0 deletions.
@@ -0,0 +1,17 @@
import sqlalchemy as sql


def upgrade(migrate_engine):
meta = sql.MetaData()
meta.bind = migrate_engine
token = sql.Table('token', meta, autoload=True)
idx = sql.Index('ix_token_valid', token.c.valid)
idx.create(migrate_engine)


def downgrade(migrate_engine):
meta = sql.MetaData()
meta.bind = migrate_engine
token = sql.Table('token', meta, autoload=True)
idx = sql.Index('ix_token_valid', token.c.valid)
idx.drop(migrate_engine)

0 comments on commit 9faf255

Please sign in to comment.