Add global registration of custom migrations.
Review Request #12268 — Created May 5, 2022 and submitted
Information | |
---|---|
chipx86 | |
Django Evolution | |
release-2.x | |
Reviewers | |
django-evolution | |
Custom migrations are used mainly in unit test suites to dynamically
construct migrations that can be applied to an app. Currently,
EvolveAppTask
accepts these and passes them toMigrationExecutor
.
However, upcoming work will involve creating aMigrationExecutor
outside of the management ofEvolveAppTask
, but with the need to use
the migrations registered there.Now,
EvolveAppTask
registers custom migrations globally when preparing
tasks, and then urnegisters them after tasks have been prepared.This is not thread-safe, but then, evolving the database is not
something that should ever be done by more than one thread (or process,
or server) at a time anyway. Plus this is really intended for unit
testing. So it's not a concern for this purpose.
All unit tests pass.
Tested along with upcoming work for a
MoveToDjangoEvolution
mutation.
Summary | |
---|---|