summaryrefslogtreecommitdiff
path: root/django/db/migrations/optimizer.py
AgeCommit message (Collapse)Author
2022-02-07Refs #33476 -- Reformatted code with Black.django-bot
2020-04-09Refs #22608 -- Made app_label required when optimizing migrations.Simon Charette
This paved the way for the removal of lot of logic when app_label was not specified.
2020-03-02Refs #26064 -- Avoided unnecessary list slicing in migration optimizer.Simon Charette
The in_between list is only necessary if an optimization is possible.
2018-07-11Removed in_between from Operation.reduce()'s signature.Simon Charette
It isn't used since FieldOperation.references_model() takes into account models referenced by the field it's operating on.
2018-07-11Fixed #27845 -- Allowed both right and left optimizations of operations.Simon Charette
Thanks Raphael Gaschignard for the suggestion.
2018-07-11Refs #27768 -- Reversed order of optimized and in-between operations.Simon Charette
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.
2017-02-28Refs #27656 -- Updated django.db docstring verbs according to PEP 257.Anton Samarchyan
2017-01-19Refs #23919 -- Stopped inheriting from object to define new style classes.Simon Charette
2017-01-18Refs #23919 -- Removed encoding preambles and future importsClaude Paroz
2016-01-23Fixed #26064 -- Moved operation reduction logic to their own class.Simon Charette
Thanks to Markus Holtermann and Tim Graham for their review.
2015-06-16Sorted reduce methods in migration optimizerMarkus Holtermann
Thanks Tim Graham for the review.
2015-06-16Fixed #24828 -- Allowed migration optimization across AlterFooTogetherMarkus Holtermann
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.
2015-06-14Changed reduce method lookup in migration optimizer to dictMarkus Holtermann
Thanks Andrew Godwin and Simon Charette for the review.
2015-06-14Explicitly imported migration operations in optimizerMarkus Holtermann
Thanks Andrew Godwin for the review.
2015-06-14Optimized duplicate AlterModelTable/AlterFooTogether/AlterOWRTMarkus Holtermann
Thanks Andrew Godwin for the review.
2015-06-14Took AlterOrderWithRespectTo into account when optimizing migrationsMarkus Holtermann
Thanks Andrew Godwin for the review.
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-01-20Fixed typos in code comments.Adam Taylor
2015-01-07Refs #23822 -- Made MigrationOptimizer aware of model managersMarkus Holtermann
2015-01-07Refs #22608 -- Optimized migration optimizerMarkus Holtermann
Moved list constants instantiation into optimizer's __init__.
2015-01-07Refs #22608 -- Optimized migration optimizer and migrate by caching calls to ↵Ulrich Petri
str.lower()
2014-10-29Limited lines to 119 characters in django/{contrib,db}.Berker Peksag
Refs #23395.
2014-06-22Fixed #22875: Optimizer did not take through= into account.Andrew Godwin
2014-06-16Fixed #22847: Optimizer wasn't expecting unresolved FKsAndrew Godwin
2014-06-15Fixed several flake8 errorsAlex Gaynor
2014-06-15Fixed #22568: Better proxy model support in migrationsAndrew Godwin
2014-06-06Fixed flake8 errors.Tim Graham
2014-06-05Rewrote migration autodetector to involve actual computer science.Andrew Godwin
Fixes #22605, #22735; also lays the ground for some other fixes.
2014-05-06Added a bunch of missing unicode_literalsClaude Paroz
Refs #22564.
2014-03-03Fixed many typos in comments and docstrings.Rodolfo Carvalho
Thanks Piotr Kasprzyk for help with the patch.
2013-12-10Fixed E124 pep8 warnings.Loic Bistuer
2013-11-06flake8 fixesAlex Gaynor
2013-11-06Massive migration optimiser improvements + RenameModel opnAndrew Godwin
2013-11-03Fixed all E226 violationsAlex Gaynor
2013-11-02More attacking E302 violatorsAlex Gaynor
2013-10-16Improve migration optimizer to be able to optimize through other opsAndrew Godwin
2013-10-02Initial version of MigrationOptimizer and testsAndrew Godwin