summaryrefslogtreecommitdiff
path: root/django/db/migrations/migration.py
AgeCommit message (Collapse)Author
2025-04-16Americanized some spellings.Adam Johnson
2022-09-27Fixed #34050 -- Replaced invalid chars in migration names with '_'.Adam Johnson
Thanks to Bishal Gautam for the report and initial implementation. Regression in fa58450a9ab8a1bdd2a5090b51b00078fd85ffa6. Co-Authored-By: Bishal Gautam <bisalgt@gmail.com>
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-04-21Fixed #33509 -- Added "(no-op)" to sqlmigrate output for operations without ↵Adam Johnson
SQL statement.
2022-02-07Refs #33476 -- Refactored code to strictly match 88 characters line length.Mariusz Felisiak
2022-02-07Refs #33476 -- Reformatted code with Black.django-bot
2021-03-12Fixed #31516 -- Improved naming of migrations with multiple operations.manav014
52 gives 60 in total (52 + 5 + 3). Co-authored-by: Adam Johnson <me@adamj.eu>
2021-03-12Refs #31516, Refs #31703 -- Made makemigrations always name initial ↵Adam Johnson
migrations "initial".
2020-06-24Fixed #31703 -- Made makemigrations name all initial migrations "initial".Jon Dufresne
When the MigrationAutodetector creates more than one initial migration in a app, name all initial migrations "initial" rather than the opaque "auto_<DATE>_<TIME>" name. Initial migrations that have a descriptive name continue to use the descriptive name.
2020-06-24Refs #31703 -- Moved MigrationAutodetector.suggest_name() to Migration.Jon Dufresne
Allows expanding the method to inspect additional attributes of the migration instance. For example, the Migration.initial attribute.
2017-09-28Simplified various __eq__() methods.Mads Jensen
2017-08-10Fixed #28386 -- Made operations within non-atomic migrations honor the ↵Evan Grim
operation's atomic flag when migrating backwards.
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 obsolete __ne__() methods.Aymeric Augustin
__ne__() defaults to the opposite of __eq__() on Python 3 when it doesn't return NotImplemented.
2017-01-18Refs #23919 -- Removed python_2_unicode_compatible decorator usageClaude Paroz
2017-01-18Refs #23919 -- Removed encoding preambles and future importsClaude Paroz
2016-02-05Fixed #25833 -- Added support for non-atomic migrations.Pankrat
Added the Migration.atomic attribute which can be set to False for non-atomic migrations.
2015-07-13Fixed #24375 -- Added Migration.initial attributeAndrei Kulakov
The new attribute is checked when the `migrate --fake-initial` option is used. initial will be set to True for all initial migrations (this is particularly useful when initial migrations are split) as well as for squashed migrations.
2015-05-02Moved migration exception classes to shared moduleMarkus Holtermann
Thanks Aymeric Augustin for the review.
2015-04-01Fixed #24554 -- Sped up migrations by rendering initial apps when they are ↵Markus Holtermann
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
2015-03-30Fixed #24550 -- Added migration operation description to sqlmigrate outputMarkus Holtermann
Thanks Tim Graham for the review.
2015-02-06Sorted imports with isort; refs #23860.Tim Graham
2015-01-11Refs #24110 -- Added a more descriptive release note and fixed a spelling ↵Markus Holtermann
mistake.
2015-01-10Fixed #24110 -- Rewrote migration unapply to preserve intermediate statesMarkus Holtermann
2015-01-02Fixed #23745 -- Reused states as much as possible in migrationsClaude Paroz
Thanks Tim Graham and Markus Holtermann for the reviews.
2014-12-21Fixed #24017 -- Added python_2_unicode_compatible in db/migrationsJosh Schneier
2014-10-29Limited lines to 119 characters in django/{contrib,db}.Berker Peksag
Refs #23395.
2014-07-29Fixed #23092: Squashing handles external dependenciesAndrew 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-04-20Fixed flake8 errors.Tim Graham
2014-04-18Fixed #22397 -- Issues removing M2M field with explicit through modelAndrew Gorcester
Changed the migration autodetector to remove models last so that FK and M2M fields will not be left as dangling references. Added a check in the migration state renderer to error out in the presence of dangling references instead of leaving them as strings. Fixed a bug in the sqlite backend to handle the deletion of M2M fields with "through" models properly (i.e., do nothing successfully). Thanks to melinath for report, loic for tests and andrewgodwin and charettes for assistance with architecture.
2014-04-18Revert "Fixed #22397 -- Issues removing M2M field with explicit through model."Simon Charette
This reverts commit 00e3b9a2a992ee0b7288eeeb03e7cbd52ebc6dce. It's causing a regression when tested with the proxy_model_inheritance tests.
2014-04-17Fixed #22397 -- Issues removing M2M field with explicit through model.Andrew Gorcester
Changed the migration autodetector to remove models last so that FK and M2M fields will not be left as dangling references. Added a check in the migration state renderer to error out in the presence of dangling references instead of leaving them as strings. Fixed a bug in the sqlite backend to handle the deletion of M2M fields with "through" models properly (i.e., do nothing successfully). Thanks to melinath for report, loic for tests and andrewgodwin and charettes for assistance with architecture.
2014-03-03Fixed many typos in comments and docstrings.Rodolfo Carvalho
Thanks Piotr Kasprzyk for help with the patch.
2014-01-19Implement swappable model support for migrationsAndrew Godwin
2013-10-23Fix migration planner to fully understand squashed migrations. And test.Andrew Godwin
2013-09-25Make sqlmigrate ignore the RunPython operationAndrew Godwin
2013-09-25Add RunPython migration operation and testsAndrew Godwin
2013-06-07Initial stab at a migrate command, it's probably quite a way off.Andrew Godwin
2013-06-07Autodetector testsAndrew Godwin
2013-05-30Add an Executor for end-to-end runningAndrew Godwin
2013-05-29Start adding operations that work and tests for themAndrew Godwin
2013-05-10First phase of loading migrations from diskAndrew Godwin