Diff from d26832fcefed0f151717d6af74a3216f82905f15 to 9f820311d8ac5874a62554bf8f513be502b6eade - copr/copr - Pagure.io

###

### copr / copr

Clone

####
Commit Diff
2 files changed
+24 -1
d26832fcefed0f151717d6af74a3216f82905f15 .. 9f820311d8ac5874a62554bf8f513be502b6eade

Merge #501 `add index build(canceled, is_background, source_status, id)`
Miroslav Suchý • 3 months ago
`9f82031`
[frontend] set webhook_rebuild even in APIv3
Jakub Kadlčík • 3 months ago
`d26832f`
frontend/coprs_frontend/alembic/schema/versions/code4beaf000_add_indexes3.py
file added
+21

    @@ -0,0 +1,21 @@
    + """add indexes3
    +
    + Revision ID: code4beaf000_add_indexes3.py
    + Revises: deadbeafc0de
    + Create Date: 2019-01-16 14:43:00.000000
    +
    + """
    + # revision identifiers, used by Alembic.
    + revision = 'code4beaf000'
    + down_revision = 'deadbeafc0de'
    +
    + from alembic import op
    + import sqlalchemy as sa
    +
    +
    + def upgrade():
    +     op.create_index('build_canceled_is_background_source_status_id_idx', 'build', ['canceled', 'is_background', 'source_status', 'id'], unique=False)
    +
    +
    + def downgrade():
    +     op.drop_index('build_canceled_is_background_source_status_id_idx', table_name='build')

frontend/coprs_frontend/coprs/models.py
file modified
+3 -1

    @@ -648,7 +648,9 @@
          __table_args__ = (db.Index('build_canceled', "canceled"),
                            db.Index('build_order', "is_background", "id"),
    -                       db.Index('build_filter', "source_type", "canceled"))
    +                       db.Index('build_filter', "source_type", "canceled"),
    +                       db.Index('build_canceled_is_background_source_status_id_idx', 'canceled', "is_background", "source_status", "id"),
    +                      )
          def __init__(self, *args, **kwargs):
              if kwargs.get('source_type') == helpers.BuildSourceEnum("custom"):