Change lookup of blobs to not use a subquery, which is murder on MySQL

This commit is contained in:
Joseph Schorr 2019-01-03 14:59:24 -05:00
parent cdb49dbfd3
commit e309508776
4 changed files with 31 additions and 40 deletions

View file

@ -233,15 +233,6 @@ def _get_storage(query_modifier):
return found
def get_storage_by_subquery(subquery):
""" Returns the storage (and its locations) for the storage id returned by the subquery. The
subquery must return at most 1 result, which is a storage ID. """
def filter_by_subquery(query):
return query.where(ImageStorage.id == subquery)
return _get_storage(filter_by_subquery)
def get_storage_by_uuid(storage_uuid):
def filter_to_uuid(query):
return query.where(ImageStorage.uuid == storage_uuid)