diff --git a/data/database.py b/data/database.py index 04c90b011..1ae5b14d0 100644 --- a/data/database.py +++ b/data/database.py @@ -1282,10 +1282,10 @@ class Tag(BaseModel): database = db read_slaves = (read_slave,) indexes = ( - (('repository', 'name', 'tag_kind'), False), - (('repository', 'name', 'hidden', 'tag_kind'), False), + (('repository', 'name'), False), + (('repository', 'name', 'hidden'), False), # This unique index prevents deadlocks when concurrently moving and deleting tags - (('repository', 'name', 'lifetime_end', 'tag_kind'), True), + (('repository', 'name', 'lifetime_end'), True), ) diff --git a/data/migrations/versions/7a525c68eb13_add_oci_app_models.py b/data/migrations/versions/7a525c68eb13_add_oci_app_models.py index c1cbd2655..1188a312d 100644 --- a/data/migrations/versions/7a525c68eb13_add_oci_app_models.py +++ b/data/migrations/versions/7a525c68eb13_add_oci_app_models.py @@ -245,9 +245,9 @@ def upgrade(tables): op.create_index('tag_linked_tag_id', 'tag', ['linked_tag_id'], unique=False) op.create_index('tag_manifest_list_id', 'tag', ['manifest_list_id'], unique=False) op.create_index('tag_repository_id', 'tag', ['repository_id'], unique=False) - op.create_index('tag_repository_id_name_hidden_tag_kind_id', 'tag', ['repository_id', 'name', 'hidden', 'tag_kind_id'], unique=False) - op.create_index('tag_repository_id_name_lifetime_end_tag_kind_id', 'tag', ['repository_id', 'name', 'lifetime_end', 'tag_kind_id'], unique=True) - op.create_index('tag_repository_id_name_tag_kind_id', 'tag', ['repository_id', 'name', 'tag_kind_id'], unique=False) + op.create_index('tag_repository_id_name_hidden', 'tag', ['repository_id', 'name', 'hidden'], unique=False) + op.create_index('tag_repository_id_name_lifetime_end', 'tag', ['repository_id', 'name', 'lifetime_end'], unique=True) + op.create_index('tag_repository_id_name', 'tag', ['repository_id', 'name'], unique=False) op.create_index('tag_tag_kind_id', 'tag', ['tag_kind_id'], unique=False) op.create_table(