| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
| |
Fixed MigrationWriter.serialize() to correctly handle migration
operations by utilizing OperationWriter.
Thanks Piotr Maliński for the report.
|
|
|
|
|
|
|
| |
OperationWriter.
Changed OperationWriter to support multi-line serialized values with
correct indentation.
|
|
|
|
| |
Thanks to knbk for the report.
|
|
|
|
| |
Thanks Claude Paroz and Tim Graham for the review
|
|
|
|
|
|
|
|
|
|
| |
apps when they are first needed
Calling Migration.mutate_state() now also allows to do in_place
mutations in case an intermediate state is thrown away later.
Thanks Anssi Kääriäinen for the idea, Ryan Hall for parts of the patch,
and Claude Paroz and Tim Graham for the review
|
|
|
|
|
|
| |
sqlmigrate output
Thanks Tim Graham for the review.
|
|
|
|
|
|
|
|
| |
graph
Made MigrationGraph forwards_plan() and backwards_plan() fall back to an
iterative approach in case the recursive approach exceeds the recursion
depth limit.
|
|
|
|
| |
renamed tests
|
|
|
|
|
| |
Thanks to David Sanders for the report and test and Simon Charette for
the review.
|
| |
|
|
|
|
|
|
|
| |
This adds a new method, Apps.lazy_model_operation(), and a helper function,
lazy_related_operation(), which together supersede add_lazy_relation() and
make lazy model operations the responsibility of the App registry. This
system no longer uses the class_prepared signal.
|
|
|
|
|
|
|
|
| |
Field.rel is now deprecated. Rel objects have now also remote_field
attribute. This means that self == self.remote_field.remote_field.
In addition, made the Rel objects a bit more like Field objects. Still,
marked ManyToManyFields as null=True.
|
|
|
|
| |
in migrations.
|
|
|
|
|
|
|
| |
--noinput option.
Changed --noinput option in makemigrations to suppress all user prompts,
not just when combined with --merge.
|
|
|
|
|
|
|
|
| |
Set apps.ready to False when rendering multiple models. This prevents
that the cache on Model._meta is expired on all models after each time a
single model is rendered. Prevented that Apps.clear_cache() refills the
cache on Apps.get_models(), so that the wrong value cannot be cached
when cloning a StateApps.
|
|
|
|
|
|
|
| |
in migrations when changing blank
Thanks Mark Tranchant for the report an Tim Graham for the test and
review.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There's no reason to assume that sys.path[0] is an appropriate location
for generating code. Specifically that doesn't work with extend_sys_path
which puts the additional directories at the end of sys.path.
In order to create a new migrations module, instead of using an
arbitrary entry from sys.path, import as much as possible from the path
to the module, then create missing submodules from there.
Without this change, the tests introduced in the following commit fail,
which seems sufficient to prevent regressions for such a refactoring.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
dependency graphs.
Switched from an adjancency list and uncached, iterative depth-first
search to a Node-based design with direct parent/child links and a
cached, recursive depth-first search. With this change, calculating
a migration plan for a large graph takes several seconds instead of
several hours.
Marked test `migrations.test_graph.GraphTests.test_dfs` as an expected
failure due to reaching the maximum recursion depth.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
allow_migrate().
The new signature enables better support for routing RunPython and
RunSQL operations, especially w.r.t. reusable and third-party apps.
This commit also takes advantage of the deprecation cycle for the old
signature to remove the backward incompatibility introduced in #22583;
RunPython and RunSQL won't call allow_migrate() when when the router
has the old signature.
Thanks Aymeric Augustin and Tim Graham for helping shape up the patch.
Refs 22583.
|
|
|
|
|
|
|
|
|
| |
with unused swappable models
Swapped out models don't have a _default_manager unless they have
explicitly defined managers. ModelState.from_model() now accounts for
this case and uses an empty list for managers if no explicit managers
are defined and a model is swapped out.
|
|
|
|
| |
MigrationWriter on Python 2.
|
|
|
|
| |
If the project path contained a non-ASCII character, Python 2 crashed.
|
|
|
|
|
|
|
|
|
|
|
| |
in migration project state
Instead of naively reloading only directly related models (FK, O2O, M2M
relationship) the project state needs to reload their relations as well
as the model changes as well. Furthermore inheriting models (and super
models) need to be reloaded in order to keep inherited fields in sync.
To prevent endless recursive calls an iterative approach is taken.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously Django only checked for the table name in CreateModel
operations in initial migrations and faked the migration automatically.
This led to various errors and unexpected behavior. The newly introduced
--fake-initial flag to the migrate command must be passed to get the
same behavior again. With this change Django will bail out in with a
"duplicate relation / table" error instead.
Thanks Carl Meyer and Tim Graham for the documentation update, report
and review.
|
|
|
|
|
|
| |
signals when unapplying initial migrations of contenttypes and auth"
This reverts commit 737d24923ac69bb8b89af1bb2f3f4c4c744349e8.
|
| |
|
| |
|
|
|
|
|
|
| |
migration writer
Thanks Tomas Dobrovolny for the report and Tim Graham for the review.
|
| |
|
|
|
|
| |
Thanks Simon and Markus for reviews.
|
|
|
|
|
|
| |
when unapplying initial migrations of contenttypes and auth
Thanks Florian Apolloner for the report and Claude Paroz and Tim Graham for the review and help on the patch.
|
|
|
|
|
|
| |
migrations
Thanks Tim Graham for the review.
|
|
|
|
|
|
| |
rendering the initial state
Thanks Tim Graham for the review.
|
|
|
|
|
|
| |
generate the initial migration state
Thanks Collin Anderson for the input when creating the patch and Tim Graham for the review.
|
|
|
|
| |
fixed a spelling mistake.
|
|
|
|
| |
intermediate states
|
|
|
|
|
|
| |
hints to the db router.
Thanks Markus Holtermann and Tim Graham for the review.
|
|
|
|
|
|
| |
RunSQL
Thanks Loïc Bistuer and Tim Graham for the discussion and review.
|
|
|
|
| |
operation kwargs that are not explicitly deconstructed
|
|
|
|
| |
managers
|
|
|
|
| |
Moved list constants instantiation into optimizer's __init__.
|
|
|
|
| |
by caching calls to str.lower()
|
|
|
|
|
|
|
| |
retrieving fields.
Thanks to Russell Keith-Magee for mentoring this Google Summer of
Code 2014 project and everyone else who helped with the patch!
|
|
|
|
|
|
| |
migrations
Thanks Tim Graham and Markus Holtermann for the reviews.
|
|
|
|
| |
Refs #23745.
|
|
|
|
| |
Refs #23745.
|
|
|
|
| |
Refs #23745.
|
|
|
|
| |
django.db.models.
|
|
|
|
|
|
| |
concrete fields and vice versa
Thanks to Michael D. Hoyle for the report and Tim Graham for the review.
|
|
|
|
| |
from code
|