Add the pulp2_subid field to the Pulp2Content model #295
Conversation
e4233e2
to
f78c865
Compare
f78c865
to
cabff97
Compare
|
Should I rename |
|
Not sure why this would cause test failures for RPM. |
cabff97
to
31701b2
Compare
yes please. |
I found this in the Django docs:
|
7485b2c
to
b029860
Compare
|
@quba42 , your changes look good, thanks! |
fixes #8137 https://pulp.plan.io/issues/8137 The intended use case is to provide one to many mapping from Pulp 2 to Pulp 3 content. This is achieved by creating multiple Pulp2Content entries that all share a single pulp2_id, and differ only via the pulp2_subid. This is needed for structured Debian migrations: https://pulp.plan.io/issues/7865 The extra Pulp2Content subrecords are added by the relevant pre_migrate_content_detail method. The reason is that it is only known what subrecords are needed once the content is actually inspected by this method.
b029860
to
56caac8
Compare
| @@ -33,9 +33,10 @@ class Pulp2Content(BaseModel): | |||
| downloaded = models.BooleanField(default=False) | |||
| pulp3_content = models.ForeignKey(Content, on_delete=models.SET_NULL, null=True) | |||
| pulp2_repo = models.ForeignKey(Pulp2Repository, on_delete=models.SET_NULL, null=True) | |||
| pulp2_subid = models.CharField(max_length=255, blank=True) | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: Should I send something on the mailing list that blank=True is preferable to null=True for string fields? I am pretty sure there are a lot of null=True string fields around the various Pulp repositories. How concerned should we be about this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's always good to have such conversations on pulp-dev. I thought we had similar in the past but if we did it was looong ago. +1 to write to the mailing list and see why we didn't go that path in some cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixes #8137
https://pulp.plan.io/issues/8137
The intended use case is to provide one to many mapping from Pulp 2 to
Pulp 3 content. This is achieved by creating multiple Pulp2Content
entries that all share a single pulp2_id, and differ only via the
pulp2_subid.
This is needed for structured Debian migrations:
https://pulp.plan.io/issues/7865
The extra Pulp2Content subrecords are added by the relevant
pre_migrate_content_detail method. The reason is that it is only known
what subrecords are needed once the content is actually inspected by
this method.