Merge pull request #1063 from coreos-inc/ihatemysql

Fix subquery delete which messes up MySQL
This commit is contained in:
josephschorr 2015-12-15 13:18:05 -05:00
commit 509f5f1a58

View file

@ -49,7 +49,10 @@ def _purge_all_repository_tags(namespace_name, repository_name):
(namespace_name, repository_name))
# Delete all manifests.
repo_tags = RepositoryTag.select().where(RepositoryTag.repository == repo.id)
repo_tags = list(RepositoryTag.select().where(RepositoryTag.repository == repo.id))
if not repo_tags:
return
TagManifest.delete().where(TagManifest.tag << repo_tags).execute()
# Delete all tags.