Have all tag code add, modify and delete both old and new style tags
This preps us for being able to use the new data model with existing repositories
This commit is contained in:
parent
36db133b86
commit
114e2c3bf2
10 changed files with 274 additions and 54 deletions
|
@ -1519,12 +1519,19 @@ class TagManifestLabelMap(BaseModel):
|
|||
broken_manifest = BooleanField(index=True, default=False)
|
||||
|
||||
|
||||
class TagToRepositoryTag(BaseModel):
|
||||
""" NOTE: Only used for the duration of the migrations. """
|
||||
repository = ForeignKeyField(Repository, index=True)
|
||||
tag = ForeignKeyField(Tag, index=True, unique=True)
|
||||
repository_tag = ForeignKeyField(RepositoryTag, index=True, unique=True)
|
||||
|
||||
|
||||
appr_classes = set([ApprTag, ApprTagKind, ApprBlobPlacementLocation, ApprManifestList,
|
||||
ApprManifestBlob, ApprBlob, ApprManifestListManifest, ApprManifest,
|
||||
ApprBlobPlacement])
|
||||
v22_classes = set([Manifest, ManifestLabel, ManifestBlob, ManifestLegacyImage, TagKind,
|
||||
ManifestChild, Tag])
|
||||
transition_classes = set([TagManifestToManifest, TagManifestLabelMap])
|
||||
transition_classes = set([TagManifestToManifest, TagManifestLabelMap, TagToRepositoryTag])
|
||||
|
||||
is_model = lambda x: inspect.isclass(x) and issubclass(x, BaseModel) and x is not BaseModel
|
||||
all_models = [model[1] for model in inspect.getmembers(sys.modules[__name__], is_model)]
|
||||
|
|
Reference in a new issue