chore(migration): migration generic store sample implementation [WIP DO_NOT_MERGE]#7387
Closed
dashrews78 wants to merge 14 commits intodashrews/migration-generic-storefrom
Closed
Conversation
|
Skipping CI for Draft Pull Request. |
|
Images are ready for the commit at cb1cd68. To use with deploy scripts, first |
d715a3d to
17c6115
Compare
2 tasks
93a3093 to
afd4fd9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
An example of what a migration may look like if we had a generic store. I created a generic migration store in #7382. This is a sample of what #7371 would look like with the generic store vs using Gorm.
I copied the policies stores for simplicity and quickness, but in reality we simply need to create an object that implements the insert and/or copy methods. All the delete, walks, etc are handled by the generic store. In my estimation that eliminates the need to do the before and after stores like we used to. The get in the generic will retrieve the proto and since those must be backwards compatible, we should only need to worry about writing the data to the new table structure.
Checklist
If any of these don't apply, please comment below.
Testing Performed
TODO(replace-me)
Use this space to explain how you tested your PR, or, if you didn't test it, why
you did not do so. Valid reasons include, for example, "CI is sufficient",
"No testable changes". Feel free to attach JSON snippets, curl commands,
screenshots.
In addition to reviewing your code, reviewers must also review your testing
instructions and make sure they are sufficient.