summaryrefslogtreecommitdiff
path: root/django/db/migrations/writer.py
AgeCommit message (Collapse)Author
2025-07-23Refs #36500 -- Rewrapped long docstrings and block comments via a script.django-bot
Rewrapped long docstrings and block comments to 79 characters + newline using script from https://github.com/medmunds/autofix-w505.
2025-04-16Fixed #36274 -- Added support for run_before and atomic in MigrationWriter.Mikuláš Poul
2023-07-12Fixed #34697 -- Fixed non-deterministic order of dependencies and ↵Yury V. Zaytsev
sets/frozensets in migrations. Co-authored-by: Dakota Hawkins <dakotahawkins@gmail.com>
2023-03-20Fixed #34420 -- Corrected the order of imports in generated migration files.Andy Chosak
2022-02-07Refs #33476 -- Reformatted code with Black.django-bot
2019-01-31Fixed #30147 -- Simplified directory creation with os.makedirs(..., ↵Jon Dufresne
exist_ok=True).
2019-01-11Refs #29738 -- Allowed registering serializers with MigrationWriter.can
2019-01-11Moved django.db.migrations.writer.SettingsReference to django.conf.Tim Graham
Reduces the possibility of circular imports.
2018-12-19Fixed #30031 -- Added --no-header option to makemigrations/squashmigrations.Dakota Hawkins
2018-05-05Fixed #28913 -- Fixed error handling when MIGRATIONS_MODULES specifies a ↵Sanket Saurav
nonexistent top-level package.
2017-09-07Reverted "Fixed #27818 -- Replaced try/except/pass with contextlib.suppress()."Tim Graham
This reverts commit 550cb3a365dee4edfdd1563224d5304de2a57fda because try/except performs better.
2017-06-28Fixed #27818 -- Replaced try/except/pass with contextlib.suppress().Mads Jensen
2017-03-04Refs #27795 -- Removed unneeded force_text callsClaude Paroz
Thanks Tim Graham for the review.
2017-02-28Refs #27656 -- Updated django.db docstring verbs according to PEP 257.Anton Samarchyan
2017-01-20Refs #23919 -- Removed django.utils._os.upath()/npath()/abspathu() usage.Tim Graham
These functions do nothing on Python 3.
2017-01-19Refs #23919 -- Removed enum ImportError handling for Python 2.Tim Graham
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-10-06Fixed #27300 -- Made makemigrations --dry-run output a string (no bytes)Claude Paroz
Thanks Markus Holtermann for the report and the review.
2016-09-17Refs #27025 -- Fixed "invalid escape sequence" warnings in Python 3.6.Tim Graham
http://bugs.python.org/issue27364
2016-08-30Fixed #25109 -- Stopped silencing explicitly specified migration modules ↵Simon Charette
import errors. Thanks Tim for the review.
2016-07-14Reverted "Fixed #25388 -- Added an option to allow disabling of migrations ↵Tim Graham
during test database creation" This reverts commit 157d7f1f1de4705daddebb77f21bd7097a74513d since it disables migrations all the time, not just during tests.
2016-03-23Fixed #25388 -- Added an option to allow disabling of migrations during test ↵Berker Peksag
database creation
2016-02-25Fixed #26151 -- Refactored MigrationWriter.serialize()Yoong Kang Lim
Thanks Markus Holtermann for review.
2015-11-26Fixed #25807 -- Instructed the migration writer about lazy objects.Simon Charette
Thanks to Trac alias mrgaolei for the report, Baptiste for the confirmation and Tim for the review.
2015-11-19Fixed #25764 -- Added support for serialization of enum.Enum in migrations.Andrei Fokau
Thanks Tim Graham for the review.
2015-09-12Refs #24919 -- Raised more helpful error message for disabled migrationsMarkus Holtermann
2015-08-31Fixed #25259 -- Added comments to header of generated migration filesTyson Clugg
2015-08-27Fixed #25280 -- Properly checked regex objects for equality to prevent ↵Markus Holtermann
infinite migrations Thanks Sayid Munawar and Tim Graham for the report, investigation and review.
2015-07-29Fixed #25185 -- Added support for functools.partial serialization in migrationsPiper Merriam
2015-07-28Fixed #25186 -- Improved migration's serialization of builtins on Python 2.Piper Merriam
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-06-15Fixed #24979 -- Removed usage of inspect.getargspec().Tim Graham
2015-04-10Fixed #24514 -- Made migration writer omit models import if it's unused.Christopher Luc
2015-04-05Fixed #24278 -- Fixed serialization of migration operations.Marten Kenbeek
Fixed MigrationWriter.serialize() to correctly handle migration operations by utilizing OperationWriter. Thanks Piotr Maliński for the report.
2015-04-05Refs #24278 -- Allowed multi-line serializations in OperationWriter.Marten Kenbeek
Changed OperationWriter to support multi-line serialized values with correct indentation.
2015-04-02Fixed #24566 -- Added support for serializing timedeltaBaptiste Mispelon
Thanks to knbk for the report.
2015-03-23Fixed #24521 -- Added support for serializing frozensets in migrations.Baptiste Mispelon
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-17Refs #24324 -- Fixed UnicodeDecodeError in MigrationWriter on Python 2.Tim Graham
2015-02-17Refs #24324 -- Fixed UnicodeDecodeError in makemigrations.Tim Graham
If the project path contained a non-ASCII character, Python 2 crashed.
2015-02-06Sorted imports with isort; refs #23860.Tim Graham
2015-01-20Fixed #24155 -- Maintained kwargs and import order in migration writerMarkus Holtermann
Thanks Tomas Dobrovolny for the report and Tim Graham for the review.
2015-01-07Fixed #24093 -- Prevented MigrationWriter to write operation kwargs that are ↵Markus Holtermann
not explicitly deconstructed
2014-12-25Fixed #23866 -- Harmonized refs to Django documentation from codeClaude Paroz
2014-12-22Fixed #23998 -- Added datetime.time support to migrations questioner.Oscar Ramirez
2014-12-15Fixed #23822 -- Added support for serializing model managers in migrationMarkus Holtermann
Thanks to Shai Berger, Loïc Bistuer, Simon Charette, Andrew Godwin, Tim Graham, Carl Meyer, and others for their review and input.
2014-12-08Fixed #23968 -- Replaced list comprehension with generators and dict ↵Jon Dufresne
comprehension
2014-12-03Fixed #23950 -- Prevented calling deconstruct on classes in MigrationWriter.Gavin Wahl
2014-11-06Fixed #23770 -- Changed serialization strategy for floats with respect to ↵Markus Holtermann
NaN and Inf Thanks to w0rp for the report