summaryrefslogtreecommitdiff
path: root/django/db/migrations/operations/base.py
AgeCommit message (Collapse)Author
2026-04-20Refs #36005 -- Made OperationCategory subclass StrEnum.Clifford Gama
2025-02-16Refs #35704 -- Used copy.replace() in Operation.reduce() methods.Adam Johnson
2024-01-17Fixed #31700 -- Made makemigrations command display meaningful symbols for ↵Amir Karimi
each operation.
2022-07-26Refs #27236 -- Reverted "Refs #27236 -- Added generic mechanism to handle ↵Mariusz Felisiak
the deprecation of migration operations." This reverts commit 41019e48bbf082c985e6ba3bad34d118b903bff1.
2022-07-08Refs #27236 -- Added generic mechanism to handle the deprecation of ↵David Wobrock
migration operations.
2022-02-07Refs #33476 -- Reformatted code with Black.django-bot
2020-05-28Fixed #31468 -- Allowed specifying migration filename in Operation.Adam Johnson
This adds also suggested filename for many built-in operations.
2020-04-09Replaced Operation._get_model_tuple() by ModelTuple.from_model().Simon Charette
This method predated the introduction of ModelTuple and had a single use.
2020-04-09Made Operation.references_model/references_field require app_label.Simon Charette
This will allow them to drop a ton of logic to deal with null app_label.
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.
2018-08-01Fixed typos in comments and docs.luz.paz
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-11Introduced ModelTuple to remove migrations boilerplate.Simon Charette
2018-07-11Fixed #27768 -- Allowed migration optimization of CreateModel order.Simon Charette
Thanks Ed Morley from Mozilla for the tests.
2017-12-30Moved _get_model_tuple() to the base Operation class.Simon Charette
This allows field and special operations to use this logic.
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 #24109 -- Allowed RunSQL and RunPython operations to be elided.Simon Charette
Thanks to Markus Holtermann and Tim Graham for their review.
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-04-18Fixed #23879 -- Allowed model migration skip based on feature/vendorClaude Paroz
Thanks Carl Meyer for the report and review, and Tim Graham for the review.
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-06Sorted imports with isort; refs #23860.Tim Graham
2015-01-10Fixed #22583 -- Allowed RunPython and RunSQL to provide hints to the db router.Loic Bistuer
Thanks Markus Holtermann and Tim Graham for the review.
2014-11-22Revert "Fixed #23892 -- Made deconstructible classes forwards compatible"Carl Meyer
This reverts commit f36151ed169813f2873e13ca9de616cfa4095321. Adding kwargs to deconstructed objects does not achieve useful forward-compatibility in general, since additional arguments are silently dropped rather than having their intended effect. In fact, it can make the failure more difficult to diagnose. Thanks Shai Berger for discussion.
2014-11-22Fixed #23892 -- Made deconstructible classes forwards compatibleCarl Meyer
2014-11-20Fixed #23844 -- Used topological sort for migration operation dependency ↵Patryk Zawadzki
resolution. This removes the concept of equality between operations to guarantee compatilibity with Python 3. Python 3 requires equality to result in identical object hashes. It's impossible to implement a unique hash that preserves equality as operations such as field creation depend on being able to accept arbitrary dicts that cannot be hashed reliably. Thanks Klaas van Schelven for the original patch in 13d613f80011852404198dfafd1f09c0c0ea42e6.
2014-11-17Reordered condition to avoid calling allow_migrate() if unneeded.twidi
2014-08-12Fixed #23275: Unmanaged models kept by autodetector, ignored by opsAndrew Godwin
2014-06-17Fixed #22853: Swapped models are now ignored for migration operations.Andrew Godwin
2014-05-07Fixed #22496: Data migrations get transactions again!Andrew Godwin
2014-05-06Added a bunch of missing unicode_literalsClaude Paroz
Refs #22564.
2014-01-20Fixed #21323 -- Improved readability of serialized Operation.Loic Bistuer
2013-11-06flake8 fixesAlex Gaynor
2013-11-06Massive migration optimiser improvements + RenameModel opnAndrew Godwin
2013-10-16Improve migration optimizer to be able to optimize through other opsAndrew Godwin
2013-10-02Initial version of MigrationOptimizer and testsAndrew Godwin
2013-09-25Add RunPython migration operation and testsAndrew Godwin
2013-09-10Fixed #20841 -- Added messages to NotImplementedErrorsGregor MacGregor
Thanks joseph at vertstudios.com for the suggestion.
2013-06-19Makemigration command now worksAndrew Godwin
2013-06-07A bit of an autodetector and a bit of a writerAndrew Godwin
2013-05-29Start adding operations that work and tests for themAndrew Godwin
2013-05-10Make a start on operations and state (not sure if final layout)Andrew Godwin