Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ObjectPermission Data Migration Strategy #3372

Closed
Tracked by #3747
HanlinMiao opened this issue Feb 27, 2023 · 3 comments · Fixed by #4450
Closed
Tracked by #3747

ObjectPermission Data Migration Strategy #3372

HanlinMiao opened this issue Feb 27, 2023 · 3 comments · Fixed by #4450
Assignees
Labels
type: documentation Improvements or additions to documentation
Milestone

Comments

@HanlinMiao
Copy link
Contributor

HanlinMiao commented Feb 27, 2023

Proposed Changes

For any models that are being removed or collapsed into models (Site and Region -> Location, Aggregate -> Prefix),
we need to keep some sort of records to trace back the old model instances that are removed along with the old model classes specifically for ObjectPermission constraints constructed by the UUIDs of old model instances:

{
    "id": "d266c50f-fdcc-4bb1-b768-2492034e1b86",
    "id__in": ["d266c50f-fdcc-4bb1-b768-2492034e1b86", "5318f8c3-c0dc-4534-9b92-458a378a0fdc"],
}

Justification

Since we decided to let admin users themselves resolve and change the constraints of ObjectPermission instances to use the new model filters after the old model classes are removed, we need to assist the user in any way possible in referencing the old model instances.

@HanlinMiao HanlinMiao added this to the v2.0.0 milestone Feb 27, 2023
@lampwins
Copy link
Member

As discussed, I think we should migrate the UUIDs to the new objects, i.e. a record keeps its same UUID through the migration. This would help not only in this case, but also external/3rd party references to records via the UUID.

Additionally, I would like to see us produce log files are part of these migrations to assist administrators if they need to trace an object.

@bryanculver
Copy link
Member

As discussed, I think we should migrate the UUIDs to the new objects, i.e. a record keeps its same UUID through the migration. This would help not only in this case, but also external/3rd party references to records via the UUID.

Additionally, I would like to see us produce log files are part of these migrations to assist administrators if they need to trace an object.

This is being done for Location, but isn't for Role, Aggregate, and potentially others. @lampwins would it be preferred to go back and do that for all models which are being collapsed into others?

@gsnider2195

This comment was marked as outdated.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: documentation Improvements or additions to documentation
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants