summaryrefslogtreecommitdiff
path: root/django/db
AgeCommit message (Collapse)Author
2015-03-30Fixed #24550 -- Added migration operation description to sqlmigrate outputMarkus Holtermann
Thanks Tim Graham for the review.
2015-03-29Fixed #19259 -- Added group by selected primary keys support.Simon Charette
2015-03-29Refs #24366 -- Fixed recursion depth error in migration graphMarten Kenbeek
Made MigrationGraph forwards_plan() and backwards_plan() fall back to an iterative approach in case the recursive approach exceeds the recursion depth limit.
2015-03-29Refs #24366 -- Renamed arguments in MigrationGraph, renamed testsMarten Kenbeek
2015-03-28Fixed #24537 -- Ignored field order in RenameModel detectionMarkus Holtermann
Thanks to David Sanders for the report and test and Simon Charette for the review.
2015-03-26Fixed #24505 -- Fixed clash with hidden m2m fields.Marco Fucci
Added support for multiple m2m fields with the same 'to' model and with related_name set to '+'.
2015-03-25Fixed #24394 -- Allowed running tests with empty default dictionary.Andrei Kulakov
2015-03-25Removed untouched branch in StateApps.__init__()Alex Hill
2015-03-25Fixed #24215 -- Refactored lazy model operationsAlex Hill
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.
2015-03-25Renamed Field.rel attribute to remote_fieldAnssi Kääriäinen
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.
2015-03-25Renamed ForeignObject.related_field to target_fieldAnssi Kääriäinen
2015-03-25Removed field.field check in setup_joins()Anssi Kääriäinen
2015-03-25Refs #24267 -- Implemented lookups for related fieldsAnssi Kääriäinen
Previously related fields didn't implement get_lookup, instead related fields were treated specially. This commit removed some of the special handling. In particular, related fields return Lookup instances now, too. Other notable changes in this commit is removal of support for annotations in names_to_path().
2015-03-24Fixed #24483 -- Prevented keepdb from breaking with generator choices.David Szotten
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`.
2015-03-24Removed getLogger alias in django.utils.log.Tim Graham
2015-03-23Fixed #12400 -- Allowed geometry fields in unique_togetherClaude Paroz
Thanks Tim Graham for the review.
2015-03-23Fixed #24521 -- Added support for serializing frozensets in migrations.Baptiste Mispelon
2015-03-23Fixed #23697 -- Improved ForeignObject.get_lookup_constraint() error message.Michael Blatherwick
2015-03-22Fixed #24485 -- Allowed combined expressions to set output_fieldJosh Smeaton
2015-03-22Fixed #24508 -- Made annotations commutativeJosh Smeaton
2015-03-21Fixed #24479 -- Added system check to prevent both ordering and order_wrt.Jon Dufresne
2015-03-21Removed double pop from meta_attrs.Jon Dufresne
2015-03-21Explicitly disable FK constraints in SQLite editorAlex Hill
2015-03-21Safer table alterations under SQLiteAlex Hill
Table alterations in SQLite require creating a new table and copying data over from the old one. This change ensures that no Django model ever exists with the temporary table name as its db_table attribute.
2015-03-18Fixed #24495 -- Allowed unsaved model instance assignment check to be bypassed.Karl Hobley
2015-03-17Fixed typo in refs #15579 comment.Tim Graham
2015-03-17Refs #24485 -- Renamed some expression typesJosh Smeaton
2015-03-17Fixed #24486 -- Fixed error with datetime and DurationField arithmeticJosh Smeaton
2015-03-17Fixed #15579 -- Added ability to delete only child models in multi-table ↵Andriy Sokolovskiy
inheritance.
2015-03-09Fixed #24171 -- Fixed failure with complex aggregate query and expressionsAnssi Kääriäinen
The query used a construct of qs.annotate().values().aggregate() where the first annotate used an F-object reference and the values() and aggregate() calls referenced that F-object. Also made sure the inner query's select clause is as simple as possible, and made sure .values().distinct().aggreate() works correctly.
2015-03-08Fixed #23407 -- Extended coverage of makemigrations --noinput option.Marten Kenbeek
Changed --noinput option in makemigrations to suppress all user prompts, not just when combined with --merge.
2015-03-08Fixed #24397 -- Sped up rendering multiple model states.Marten Kenbeek
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.
2015-03-07Fixed #24447 -- Made migrations add FK constraints for existing columnsJean-Louis Fuchs
When altering from e.g. an IntegerField to a ForeignKey, Django didn't add a constraint.
2015-03-06Fixed #24420 -- Allowed ordering by case expressionsJosh Smeaton
2015-03-04Fixed #24435 -- Prevented m2m field removal and addition in migrations when ↵Markus Holtermann
changing blank Thanks Mark Tranchant for the report an Tim Graham for the test and review.
2015-03-02Fixed MySQL build failure introduced by refs #24390.Tim Graham
Added table_name back to _create_index_sql() to prevent duplicate index names on MySQL.
2015-03-02Fixed #24390 -- Made migration index names deterministic.László Károlyi
2015-02-27Fixed #24418 -- Prevented crash in refresh_from_db with null fkClaude Paroz
Thanks Johannes Lerch for the report, Tim Graham for the test case, and Simon Charette for the review.
2015-02-23Prevented makemigrations from writing in sys.path[0].Aymeric Augustin
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.
2015-02-23Fixed #24381 -- removed ForeignObjectRel opts and to_optsAnssi Kääriäinen
These cached properies were causing problems with pickling, and in addition they were confusingly defined: field.rel.model._meta was not the same as field.rel.opts. Instead users should use field.rel.related_model._meta inplace of field.rel.opts, and field.rel.to._meta in place of field.rel.to_opts.
2015-02-23Fixed #24366 -- Optimized traversal of large migration dependency graphs.Marten Kenbeek
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.
2015-02-22Fixed signature of BaseDatabaseOperations.date_interval_sql() and document ↵Michael Manfre
the change.
2015-02-21Fixed #24376 -- added verbose_name arg to UUIDFieldMichael Angeletti
2015-02-20Fixed typo in django/db/models/fields/files.py comment.Don Kirkby
2015-02-20Fixed #24328 -- cleaned up Options._get_fields() implementationAnssi Kääriäinen
2015-02-20Fixed #24351, #24346 -- Changed the signature of allow_migrate().Loic Bistuer
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.
2015-02-20Update converters to take a consistent set of parameters.Marc Tamlyn
As suggested by Anssi. This has the slightly strange side effect of passing the expression to Expression.convert_value has the expression passed back to it, but it allows more complex patterns of expressions.
2015-02-20Fixed #24343 -- Ensure db converters are used for foreign keys.Marc Tamlyn
Joint effort between myself, Josh, Anssi and Shai.
2015-02-19Fixed #24307: Avoided redundant column nullability modifications on OracleShai Berger
Thanks Joris Benschop for the report, and Tim Graham for the tests.
2015-02-18Fixed #24291 - Fixed migration ModelState generation with unused swappable ↵Marten Kenbeek
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.