Merge pull request #3367 from quay/add-additional-missing-indexes
Add an index on the logs_archived boolean on a RepositoryBuild
This commit is contained in:
commit
154c17bd3c
2 changed files with 25 additions and 1 deletions
|
@ -997,7 +997,7 @@ class RepositoryBuild(BaseModel):
|
|||
trigger = ForeignKeyField(RepositoryBuildTrigger, null=True)
|
||||
pull_robot = QuayUserField(null=True, backref='buildpullrobot', allows_robots=True,
|
||||
robot_null_delete=True)
|
||||
logs_archived = BooleanField(default=False)
|
||||
logs_archived = BooleanField(default=False, index=True)
|
||||
queue_id = CharField(null=True, index=True)
|
||||
|
||||
class Meta:
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
"""Add index on logs_archived on repositorybuild
|
||||
|
||||
Revision ID: 481623ba00ba
|
||||
Revises: b9045731c4de
|
||||
Create Date: 2019-02-15 16:09:47.326805
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '481623ba00ba'
|
||||
down_revision = 'b9045731c4de'
|
||||
|
||||
from alembic import op
|
||||
|
||||
def upgrade(tables, tester):
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_index('repositorybuild_logs_archived', 'repositorybuild', ['logs_archived'], unique=False)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade(tables, tester):
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_index('repositorybuild_logs_archived', table_name='repositorybuild')
|
||||
# ### end Alembic commands ###
|
Reference in a new issue