Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migration: Add composite index in manifestblob (PROJQUAY-1922) #769

Merged
merged 1 commit into from
Apr 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions data/migrations/dba_operator/909d725887d3-databasemigration.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

---
apiVersion: dbaoperator.app-sre.redhat.com/v1alpha1
kind: DatabaseMigration
metadata:
name: 909d725887d3
spec:
migrationContainerSpec:
command:
- /quay-registry/quay-entrypoint.sh
- migrate
- 909d725887d3
image: quay.io/quay/quay
name: 909d725887d3
previous: 88e64904d000
schemaHints:
- columns: []
indexName: manifestblob_repository_id_blob_id
indexType: index
operation: createIndex
table: manifestblob
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
"""Add composite index on manifestblob

Revision ID: 909d725887d3
Revises: 88e64904d000
Create Date: 2021-04-23 14:48:21.156441

"""

# revision identifiers, used by Alembic.
revision = "909d725887d3"
down_revision = "88e64904d000"

import sqlalchemy as sa


def upgrade(op, tables, tester):
op.create_index(
"manifestblob_repository_id_blob_id",
"manifestblob",
["repository_id", "blob_id"],
)


def downgrade(op, tables, tester):
op.drop_index("manifestblob_repository_id_blob_id", table_name="manifestblob")