Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/django/db/migrations
Commit message (Collapse)AuthorAgeFilesLines
...
* Fixed #24278 -- Fixed serialization of migration operations.Marten Kenbeek2015-04-051-0/+5
| | | | | | | Fixed MigrationWriter.serialize() to correctly handle migration operations by utilizing OperationWriter. Thanks Piotr Maliński for the report.
* Refs #24278 -- Allowed multi-line serializations in ↵Marten Kenbeek2015-04-052-6/+27
| | | | | | | OperationWriter. Changed OperationWriter to support multi-line serialized values with correct indentation.
* Fixed #24566 -- Added support for serializing timedeltaBaptiste Mispelon2015-04-021-0/+3
| | | | Thanks to knbk for the report.
* Refs #24554 -- Prevented rendering of unused migrationsMarkus Holtermann2015-04-011-0/+9
| | | | Thanks Claude Paroz and Tim Graham for the review
* Fixed #24554 -- Sped up migrations by rendering initial ↵Markus Holtermann2015-04-014-11/+28
| | | | | | | | | | 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
* Fixed #24550 -- Added migration operation description to ↵Markus Holtermann2015-03-301-9/+14
| | | | | | sqlmigrate output Thanks Tim Graham for the review.
* Refs #24366 -- Fixed recursion depth error in migration ↵Marten Kenbeek2015-03-291-2/+43
| | | | | | | | graph Made MigrationGraph forwards_plan() and backwards_plan() fall back to an iterative approach in case the recursive approach exceeds the recursion depth limit.
* Refs #24366 -- Renamed arguments in MigrationGraph, ↵Marten Kenbeek2015-03-291-10/+12
| | | | renamed tests
* Fixed #24537 -- Ignored field order in RenameModel detectionMarkus Holtermann2015-03-281-1/+1
| | | | | Thanks to David Sanders for the report and test and Simon Charette for the review.
* Removed untouched branch in StateApps.__init__()Alex Hill2015-03-251-16/+8
|
* Fixed #24215 -- Refactored lazy model operationsAlex Hill2015-03-251-11/+10
| | | | | | | 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.
* Renamed Field.rel attribute to remote_fieldAnssi Kääriäinen2015-03-255-56/+56
| | | | | | | | 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.
* Fixed #24521 -- Added support for serializing frozensets ↵Baptiste Mispelon2015-03-231-1/+3
| | | | in migrations.
* Fixed #23407 -- Extended coverage of makemigrations ↵Marten Kenbeek2015-03-081-0/+11
| | | | | | | --noinput option. Changed --noinput option in makemigrations to suppress all user prompts, not just when combined with --merge.
* Fixed #24397 -- Sped up rendering multiple model states.Marten Kenbeek2015-03-081-0/+7
| | | | | | | | 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.
* Fixed #24435 -- Prevented m2m field removal and addition ↵Markus Holtermann2015-03-041-2/+11
| | | | | | | in migrations when changing blank Thanks Mark Tranchant for the report an Tim Graham for the test and review.
* Prevented makemigrations from writing in sys.path[0].Aymeric Augustin2015-02-231-31/+54
| | | | | | | | | | | | | 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.
* Fixed #24366 -- Optimized traversal of large migration ↵Marten Kenbeek2015-02-232-31/+92
| | | | | | | | | | | | | 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.
* Fixed #24351, #24346 -- Changed the signature of ↵Loic Bistuer2015-02-204-24/+28
| | | | | | | | | | | | | | | | 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.
* Fixed #24291 - Fixed migration ModelState generation ↵Marten Kenbeek2015-02-181-18/+21
| | | | | | | | | 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.
* Refs #24324 -- Fixed UnicodeDecodeError in ↵Tim Graham2015-02-181-2/+2
| | | | MigrationWriter on Python 2.
* Refs #24324 -- Fixed UnicodeDecodeError in makemigrations.Tim Graham2015-02-171-1/+2
| | | | If the project path contained a non-ASCII character, Python 2 crashed.
* Fixed #24225, #24264, #24282 -- Rewrote model reloading ↵Markus Holtermann2015-02-161-41/+111
| | | | | | | | | | | 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.
* Fixed #24184 -- Prevented automatic soft-apply of migrationsMarkus Holtermann2015-02-131-8/+9
| | | | | | | | | | | | 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.
* Revert "Fixed #24075 -- Prevented running post_migrate ↵Markus Holtermann2015-02-071-12/+0
| | | | | | signals when unapplying initial migrations of contenttypes and auth" This reverts commit 737d24923ac69bb8b89af1bb2f3f4c4c744349e8.
* Sorted imports with isort; refs #23860.Tim Graham2015-02-0610-19/+22
|
* Fixed typos in code comments.Adam Taylor2015-01-202-2/+2
|
* Fixed #24155 -- Maintained kwargs and import order in ↵Markus Holtermann2015-01-201-7/+9
| | | | | | migration writer Thanks Tomas Dobrovolny for the report and Tim Graham for the review.
* Removed the syncdb command per deprecation timeline.Tim Graham2015-01-171-1/+1
|
* Fixed #24135 -- Made RenameModel rename many-to-many tables.Tim Graham2015-01-161-0/+21
| | | | Thanks Simon and Markus for reviews.
* Fixed #24075 -- Prevented running post_migrate signals ↵Markus Holtermann2015-01-141-0/+12
| | | | | | 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.
* Fixed #24147 -- Prevented managers leaking model during ↵Markus Holtermann2015-01-141-3/+15
| | | | | | migrations Thanks Tim Graham for the review.
* Fixed #24129 -- Added indicator that migrations are ↵Markus Holtermann2015-01-121-0/+4
| | | | | | rendering the initial state Thanks Tim Graham for the review.
* Fixed #24123 -- Used all available migrations to ↵Markus Holtermann2015-01-121-7/+25
| | | | | | generate the initial migration state Thanks Collin Anderson for the input when creating the patch and Tim Graham for the review.
* Refs #24110 -- Added a more descriptive release note and ↵Markus Holtermann2015-01-111-1/+1
| | | | fixed a spelling mistake.
* Fixed #24110 -- Rewrote migration unapply to preserve ↵Markus Holtermann2015-01-101-15/+26
| | | | intermediate states
* Fixed #22583 -- Allowed RunPython and RunSQL to provide ↵Loic Bistuer2015-01-092-19/+27
| | | | | | hints to the db router. Thanks Markus Holtermann and Tim Graham for the review.
* Fixed #24098 -- Added no-op attributes to RunPython and ↵Markus Holtermann2015-01-091-5/+10
| | | | | | RunSQL Thanks Loïc Bistuer and Tim Graham for the discussion and review.
* Fixed #24093 -- Prevented MigrationWriter to write ↵Markus Holtermann2015-01-081-25/+39
| | | | operation kwargs that are not explicitly deconstructed
* Refs #23822 -- Made MigrationOptimizer aware of model ↵Markus Holtermann2015-01-071-0/+5
| | | | managers
* Refs #22608 -- Optimized migration optimizerMarkus Holtermann2015-01-071-73/+75
| | | | Moved list constants instantiation into optimizer's __init__.
* Refs #22608 -- Optimized migration optimizer and migrate ↵Ulrich Petri2015-01-075-91/+180
| | | | by caching calls to str.lower()
* Fixed #12663 -- Formalized the Model._meta API for ↵Daniel Pyrathon2015-01-074-55/+43
| | | | | | | retrieving fields. Thanks to Russell Keith-Magee for mentoring this Google Summer of Code 2014 project and everyone else who helped with the patch!
* Fixed #23745 -- Reused states as much as possible in ↵Claude Paroz2015-01-025-31/+105
| | | | | | migrations Thanks Tim Graham and Markus Holtermann for the reviews.
* Passed around the state between migrationsClaude Paroz2015-01-021-9/+16
| | | | Refs #23745.
* Added ignore_swappable to StateAppsMarkus Holtermann2015-01-022-2/+7
| | | | Refs #23745.
* Replaced migration state render() by apps cached propertyClaude Paroz2015-01-026-106/+99
| | | | Refs #23745.
* Renamed variables to avoid name collision with import of ↵Russell Keith-Magee2014-12-311-4/+4
| | | | django.db.models.
* Fixed #23938 -- Added migration support for m2m to ↵Markus Holtermann2014-12-291-77/+80
| | | | | | concrete fields and vice versa Thanks to Michael D. Hoyle for the report and Tim Graham for the review.
* Fixed #23866 -- Harmonized refs to Django documentation ↵Claude Paroz2014-12-252-6/+8
| | | | from code