diff --git a/data/database.py b/data/database.py index 24598f29c..35dd3e66a 100644 --- a/data/database.py +++ b/data/database.py @@ -1006,7 +1006,7 @@ class BlobPlacementLocation(BaseModel): class BlobPlacementLocationPreference(BaseModel): """ BlobPlacementLocationPreference is a location to which a user's data will be replicated. """ - user = QuayUserField(index=True, allow_robots=False) + user = QuayUserField(index=True, allows_robots=False) location = ForeignKeyField(BlobPlacementLocation) @@ -1124,9 +1124,9 @@ class DerivedImage(BaseModel): source_manifest = ForeignKeyField(Manifest) derived_manifest_json = JSONField() media_type = ForeignKeyField(MediaType) - blob = ForeignKeyField(Blob) + blob = ForeignKeyField(Blob, related_name='blob') uniqueness_hash = CharField(index=True, unique=True) - signature_blob = ForeignKeyField(Blob, null=True) + signature_blob = ForeignKeyField(Blob, null=True, related_name='signature_blob') class Meta: database = db @@ -1154,7 +1154,7 @@ class Tag(BaseModel): (('repository', 'name'), False), # This unique index prevents deadlocks when concurrently moving and deleting tags - (('repository', 'name', 'lifetime_end_ts'), True), + (('repository', 'name', 'lifetime_end'), True), )