Skip to content

Commit

Permalink
Merge fdca00a into 3f675d5
Browse files Browse the repository at this point in the history
  • Loading branch information
dianaclarke committed Aug 9, 2021
2 parents 3f675d5 + fdca00a commit 4ae9f37
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
6 changes: 6 additions & 0 deletions conbench/entities/distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ class Distribution(Base, EntityMixin):
unique=True,
)

s.Index(
"distribution_commit_machine_index",
Distribution.commit_id,
Distribution.machine_hash,
)


def get_commit_index(repository):
ordered = (
Expand Down
28 changes: 28 additions & 0 deletions migrations/versions/fb23ffd732d3_commit_machine_index.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
"""commit machine index
Revision ID: fb23ffd732d3
Revises: 4ec34b75f4c6
Create Date: 2021-08-09 12:37:56.655438
"""
from alembic import op


# revision identifiers, used by Alembic.
revision = "fb23ffd732d3"
down_revision = "4ec34b75f4c6"
branch_labels = None
depends_on = None


def upgrade():
op.create_index(
"distribution_commit_machine_index",
"distribution",
["commit_id", "machine_hash"],
unique=False,
)


def downgrade():
op.drop_index("distribution_commit_machine_index", table_name="distribution")

0 comments on commit 4ae9f37

Please sign in to comment.