Add missing index on retries_remaining
This commit is contained in:
parent
af1d4e8dc8
commit
9f2d6282bd
2 changed files with 27 additions and 1 deletions
|
@ -606,7 +606,7 @@ class QueueItem(BaseModel):
|
|||
available_after = DateTimeField(default=datetime.utcnow, index=True)
|
||||
available = BooleanField(default=True, index=True)
|
||||
processing_expires = DateTimeField(null=True, index=True)
|
||||
retries_remaining = IntegerField(default=5)
|
||||
retries_remaining = IntegerField(default=5, index=True)
|
||||
|
||||
|
||||
class RepositoryBuild(BaseModel):
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
"""Add index to retries_remaining
|
||||
|
||||
Revision ID: 246df01a6d51
|
||||
Revises: 5232a5610a0a
|
||||
Create Date: 2015-08-04 17:59:42.262877
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '246df01a6d51'
|
||||
down_revision = '5232a5610a0a'
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
def upgrade(tables):
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_index('queueitem_retries_remaining', 'queueitem', ['retries_remaining'], unique=False)
|
||||
### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade(tables):
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_index('queueitem_retries_remaining', table_name='queueitem')
|
||||
### end Alembic commands ###
|
Reference in a new issue