| Age | Commit message (Collapse) | Author |
|
|
|
Nested deconstruction should recursively deconstruct items within list,
tuple and dict values.
|
|
Added apps to unmigrated apps if the migrations module is a file
or a folder missing __init__.py.
Thanks to Ernest0x for the bug report.
|
|
|
|
tests.
|
|
Thanks Aymeric Augustin for the review.
|
|
This is a regression caused by introducing rendered migration states in
1aa3e09c2043 and the _meta refactoring in fb48eb05816b.
Thanks to Danilo Bargen for reporting the issue and Marten Kenbeek and
Tim Graham for triaging the bug and providing the initial test case.
|
|
Thanks to Reto Aebersold for reporting the issue and Tim Graham and
Claude Paroz for the review.
|
|
Thanks tttomekkk for the report.
|
|
Changed ModelState.clone() to create a shallow copy of self.fields
and self.managers.
|
|
Created bulk_update() context manager on StateApps. Sped up unregistering
models in reload_models() by using this context mananger.
|
|
Thanks Simon Percivall for the report, and Simon Charette and Tim
Graham for the reviews.
|
|
|
|
Currently some of the migrations tests rely on the fact 'input' is aliased
because of six, instead of using mock.patch. Replace this code with proper
use of mock.patch.
Also, replace one case of excessively specific python version check with
testing six.PY3
|
|
This also prevents state modifications from corrupting previous states.
Previously, when a model defining a relation was unregistered first,
clearing the cache would cause its related models' _meta to be cleared
and would result in the old models losing track of their relations.
|
|
Fixed MigrationWriter.serialize() to correctly handle migration
operations by utilizing OperationWriter.
Thanks Piotr Maliński for the report.
|
|
Changed OperationWriter to support multi-line serialized values with
correct indentation.
|
|
Thanks to knbk for the report.
|
|
Thanks Tim Graham for the review.
|
|
Made MigrationGraph forwards_plan() and backwards_plan() fall back to an
iterative approach in case the recursive approach exceeds the recursion
depth limit.
|
|
|
|
Thanks to David Sanders for the report and test and Simon Charette for
the review.
|
|
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.
|
|
If Field.choices is provided as an iterator, consume it in __init__ instead
of using itertools.tee (which ends up holding everything in memory
anyway). Fixes a bug where deconstruct() was consuming the iterator but
bypassing the call to `tee`.
|
|
|
|
Also added display of migration to stdout when verbosity=3.
|
|
migrating a subclass's name change
Forwardport of test and release note from stable/1.7.x
|
|
Changed --noinput option in makemigrations to suppress all user prompts,
not just when combined with --merge.
|
|
changing blank
Thanks Mark Tranchant for the report an Tim Graham for the test and
review.
|
|
This is preferrable to writing in the current working directory because
it eliminates the risk to leak unwanted files, which can result in very
weird test failures.
Also this will help if we ever try to run these tests concurrently.
|
|
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.
|
|
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.
|
|
Thanks Tim Graham for pointing out the fix.
|
|
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.
|
|
contains non-ASCII characters.
|
|
|
|
Thanks Jeff Singer for the test case.
|
|
When the primary key column is altered, foreign keys of referencing
models must be aware of a possible data type change as well and thus
need to be re-rendered.
Thanks Tim Graham for the report.
|
|
in migrations
When a related field is deleted, the related model must be updated. As
unchanged models are shared in migration states, the related model must
be re-rendered so that the change applies to a new copy of the related
model.
Thanks Henrik Heimbuerger for the report.
|
|
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.
|
|
|
|
|
|
A change in Python test discovery [1] causes the old packages that raised
an error to be discovered; now we use a common directory that's
ignored during discovery. Refs #23763.
[1] http://bugs.python.org/issue7559
|
|
|
|
Thanks Tomas Dobrovolny for the report and Tim Graham for the review.
|
|
|
|
|
|
Thanks Simon and Markus for reviews.
|
|
|
|
Thanks Tim Graham for the review.
|