summaryrefslogtreecommitdiff
path: root/django/db/migrations/optimizer.py
Commit message (Collapse)AuthorAgeFilesLines
* Refs #33476 -- Reformatted code with Black.django-bot2022-02-071-4/+4
|
* Refs #22608 -- Made app_label required when optimizing migrations.Simon Charette2020-04-091-5/+4
| | | | | This paved the way for the removal of lot of logic when app_label was not specified.
* Refs #26064 -- Avoided unnecessary list slicing in migration optimizer.Simon Charette2020-03-021-1/+1
| | | The in_between list is only necessary if an optimization is possible.
* Removed in_between from Operation.reduce()'s signature.Simon Charette2018-07-111-2/+2
| | | | | It isn't used since FieldOperation.references_model() takes into account models referenced by the field it's operating on.
* Fixed #27845 -- Allowed both right and left optimizations of operations.Simon Charette2018-07-111-8/+16
| | | | Thanks Raphael Gaschignard for the suggestion.
* Refs #27768 -- Reversed order of optimized and in-between operations.Simon Charette2018-07-111-2/+3
| | | | | | Operations can only be optimized through if they don't reference any of the state the operation they are compared against defines or alters, so it's safe to reverse the order.
* Refs #27656 -- Updated django.db docstring verbs according to PEP 257.Anton Samarchyan2017-02-281-4/+2
|
* Refs #23919 -- Stopped inheriting from object to define new style classes.Simon Charette2017-01-191-1/+1
|
* Refs #23919 -- Removed encoding preambles and future importsClaude Paroz2017-01-181-3/+0
|
* Fixed #26064 -- Moved operation reduction logic to their own class.Simon Charette2016-01-231-305/+6
| | | | Thanks to Markus Holtermann and Tim Graham for their review.
* Sorted reduce methods in migration optimizerMarkus Holtermann2015-06-161-60/+70
| | | | Thanks Tim Graham for the review.
* Fixed #24828 -- Allowed migration optimization across AlterFooTogetherMarkus Holtermann2015-06-161-0/+24
| | | | | | | | | | | | | | The idea behind this change is, that AlterUniqueTogether, AlterIndexTogether and AlterOrderWithRespectTo can always be moved after an Add/Alter/Rename/RemoveField operation if they don't refer to the respective field and are not empty sets / None. Combined with the optimizations of duplicate AlterUniqueTogether, AlterIndexTogether, and AlterOrderWithRespectTo operations from 128caa1e16ec2627737748f75c8e55600a3df97f, these operations are optimized in a later round of the optimizer. Thanks Tim Graham for the review.
* Changed reduce method lookup in migration optimizer to dictMarkus Holtermann2015-06-141-110/+29
| | | | Thanks Andrew Godwin and Simon Charette for the review.
* Explicitly imported migration operations in optimizerMarkus Holtermann2015-06-141-60/+64
| | | | Thanks Andrew Godwin for the review.
* Optimized duplicate AlterModelTable/AlterFooTogether/AlterOWRTMarkus Holtermann2015-06-141-0/+28
| | | | Thanks Andrew Godwin for the review.
* Took AlterOrderWithRespectTo into account when optimizing migrationsMarkus Holtermann2015-06-141-0/+6
| | | | Thanks Andrew Godwin for the review.
* Renamed Field.rel attribute to remote_fieldAnssi Kääriäinen2015-03-251-4/+4
| | | | | | | | 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 typos in code comments.Adam Taylor2015-01-201-1/+1
|
* Refs #23822 -- Made MigrationOptimizer aware of model managersMarkus Holtermann2015-01-071-0/+5
|
* 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 by caching calls to ↵Ulrich Petri2015-01-071-18/+21
| | | | str.lower()
* Limited lines to 119 characters in django/{contrib,db}.Berker Peksag2014-10-291-3/+6
| | | | Refs #23395.
* Fixed #22875: Optimizer did not take through= into account.Andrew Godwin2014-06-221-5/+20
|
* Fixed #22847: Optimizer wasn't expecting unresolved FKsAndrew Godwin2014-06-161-4/+7
|
* Fixed several flake8 errorsAlex Gaynor2014-06-151-2/+2
|
* Fixed #22568: Better proxy model support in migrationsAndrew Godwin2014-06-151-1/+2
|
* Fixed flake8 errors.Tim Graham2014-06-061-1/+1
|
* Rewrote migration autodetector to involve actual computer science.Andrew Godwin2014-06-051-17/+26
| | | | Fixes #22605, #22735; also lays the ground for some other fixes.
* Added a bunch of missing unicode_literalsClaude Paroz2014-05-061-0/+2
| | | | Refs #22564.
* Fixed many typos in comments and docstrings.Rodolfo Carvalho2014-03-031-4/+4
| | | | Thanks Piotr Kasprzyk for help with the patch.
* Fixed E124 pep8 warnings.Loic Bistuer2013-12-101-50/+64
|
* flake8 fixesAlex Gaynor2013-11-061-24/+24
|
* Massive migration optimiser improvements + RenameModel opnAndrew Godwin2013-11-061-10/+207
|
* Fixed all E226 violationsAlex Gaynor2013-11-031-3/+3
|
* More attacking E302 violatorsAlex Gaynor2013-11-021-0/+1
|
* Improve migration optimizer to be able to optimize through other opsAndrew Godwin2013-10-161-5/+20
|
* Initial version of MigrationOptimizer and testsAndrew Godwin2013-10-021-0/+104