fixtures for testimonials #1176
Closed
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.
What are the relevant tickets?
Closes https://github.com/mitodl/hq/issues/4687
Description (What does it do?)
This PR is a POC implementation and part of an ongoing discussion about how we should handle data migrations for one-off static fixtures.
I had 3 approaching this that I tried.
Approach 1 (pr): Add fixtures in as a data migration that runs inline with regular migration process
potential issues:
Approach 2 (branch): create a separate app for handling migrations and cross reference dependent migrations in other apps:
potential issues:
makemigrations- a new migration is generated in testimonials app that also has a dependency on 0005_rename_avatar_attestation_avatar_test.py and is unaware of the data migration in data_fixtures app - there is ambiguity on which migration should get executed first - running manage.py migrate in shell succeeds but migrations fail in testcasesApproach 3 (this branch): create a separate app for handling migrations and use a flag to control when the app's migrations run and make sure it always runs last
How this is setup:
RUN_DATA_MIGRATIONS=true python manage.py migratepotential issues: