summaryrefslogtreecommitdiff
path: root/django/db/migrations
AgeCommit message (Collapse)Author
2018-07-27Fixed #29595 -- Allowed using timedelta in migrations questioner.Tim Graham
Refs #29600 -- Removed usage of django.utils.datetime_safe in migrations.
2018-07-19Refs #28862 -- Removed the FieldRelatedOptionOperation.reduce() optimization.Simon Charette
It isn't required anymore since AlterTogetherOperations can be reduced into CreateModels which can reduce DeleteField operations.
2018-07-19Fixed #26906 -- Reduced alter together operations code duplication.Simon Charette
Thanks Akshesh Doshi for the initial patch.
2018-07-19Fixed #27731 -- Implemented CreateModel/AlterFooOperation reduction.Simon Charette
This should alleviate the side effects of disabling the AlterFooOperation reduction with RemoveField to fix refs #28862 during migration squashing because CreateModel can perform a reduction with RemoveField. Thanks Nick Pope for the review.
2018-07-19Fixed #28862 -- Disabled optimization of AlterFooTogether and RemoveField.Simon Charette
AlterFooTogether operations cannot be swapped with RemoveField operations on the same model as they could be removing the the same field as well. Since AlterFooTogether operations don't track what their previous value was, it's impossible to determine whether or not the optimization is safe so the only way to proceed is to disable the optimization. Thanks Ramiro Morales for the in-depth analysis of the issue. Refs #24828
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-11Allowed RemoveField operations to be optimized through.Simon Charette
2018-07-11Relaxed FieldOperation.references_field remote field checking.Simon Charette
2018-07-11Introduced ModelTuple to remove migrations boilerplate.Simon Charette
2018-07-11Fixed #26720 -- Prevented invalid CreateModel optimizations of related fields.Simon Charette
2018-07-11Fixed #27768 -- Allowed migration optimization of CreateModel order.Simon Charette
Thanks Ed Morley from Mozilla for the tests.
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.
2018-07-10Fixed #11964 -- Added support for database check constraints.Ian Foote
2018-06-28Fixed #29514 -- Reverted "Used datetime.timezone.utc instead of pytz.utc for ↵Tim Graham
better performance." This reverts commit 27ca5ce19f5f184018a61611c1bc319113b1d107 due to a regression.
2018-06-15Fixed #29000 -- Fixed RenameModel's renaming of a M2M column when run after ↵Jeff
RenameField. Regression in 45ded053b1f4320284aa5dac63052f6d1baefea9.
2018-05-05Fixed #28913 -- Fixed error handling when MIGRATIONS_MODULES specifies a ↵Sanket Saurav
nonexistent top-level package.
2018-03-28Fixed #29245 -- Made autodetector treat field renames + db_column addition ↵Simon Charette
as RenameField.
2018-03-23Fixed #23406 -- Allowed migrations to be loaded from .pyc files.Dan Watson
2018-03-20Used datetime.timezone.utc instead of pytz.utc for better performance.Sergey Fedoseev
2018-03-09Fixed #29180 -- Fixed a regression where migrations already in the plan were ↵Carlton Gibson
readded. Regression in a38ae914d89809aed6d79337b74a8b31b6d3849a.
2018-03-09Refs #29180 -- Added MigrationGraph._generate_plan() for testing.Carlton Gibson
2018-02-05Refs #28814 -- Fixed migrations crash with namespace packages on Python 3.7.Tim Graham
Due to https://bugs.python.org/issue32303.
2018-02-05Refs #28814 -- Imported from collections.abc to fix Python 3.7 deprecation ↵Raymond Hettinger
warnings. https://bugs.python.org/issue25988
2018-01-31Fixed #29091 -- Fixed makemigrations crash if migrations directory doesn't ↵Tim Graham
have __init__.py. Regression in aadd3aeb2ba3153e35bd805c80c901f289a6f333.
2018-01-12Fixed #28996 -- Simplified some boolean constructs and removed trivial ↵Дилян Палаузов
continue statements.
2018-01-03Fixed #28984 -- Made assorted code simplifications.Tim Graham
2017-12-30Fixed #25817 -- Made RenameField repoint to_field/to_fields references.Simon Charette
Also updated the autodetector to assume the RenameField operation will perform the required repointing.
2017-12-30Moved _get_model_tuple() to the base Operation class.Simon Charette
This allows field and special operations to use this logic.
2017-12-28Removed unnecessary trailing commas and spaces in various code.Mariusz Felisiak
2017-12-11Fixed #28909 -- Simplified code using tuple/list/set/dict unpacking.Nick Pope
2017-12-06Fixed #28893 -- Removed unnecessary dict.items() calls.Tim Graham
2017-12-06Fixed #28870 -- Added support for functools.partialmethod serialization in ↵Sergey Fedoseev
migrations.
2017-12-04Fixed #28860 -- Removed unnecessary len() calls.Дилян Палаузов
2017-12-01Fixed #28305 -- Fixed "Cannot change column 'x': used in a foreign key ↵Tim Graham
constraint" crash on MySQL with a sequence of AlterField or RenameField operations. Regression in 45ded053b1f4320284aa5dac63052f6d1baefea9.
2017-11-28Fixed #28853 -- Updated connection.cursor() uses to use a context manager.Jon Dufresne
2017-11-14Fixed #28795 -- Removed 'not in' checks and used dict.setdefault().Дилян Палаузов
2017-11-13Used BaseSimpleSerializer for serializing str and bytes in migrations.Sergey Fedoseev
Follow up to c716fe87821df00f9f03ecc761c914d1682591a2.
2017-09-28Simplified various __eq__() methods.Mads Jensen
2017-09-10Removed unnecessary parens in _get_app_label_and_model_name().Mariusz Felisiak
2017-09-07Reverted "Fixed #27818 -- Replaced try/except/pass with contextlib.suppress()."Tim Graham
This reverts commit 550cb3a365dee4edfdd1563224d5304de2a57fda because try/except performs better.
2017-09-04Fixed #28493 -- Made migrations autodetector find dependencies for model ↵Jeremy Satterfield
renaming.
2017-08-25Simplified migrations.state.ProjectState.__eq__().Sergey Fedoseev
2017-08-23Simplified migrations.graph.Node.iterative_dfs(), ancestors(), and ↵Sergey Fedoseev
descendants().
2017-08-22Simplified usage of sets in MigrationAutodetector.Sergey Fedoseev
2017-08-10Fixed #28386 -- Made operations within non-atomic migrations honor the ↵Evan Grim
operation's atomic flag when migrating backwards.
2017-07-31Avoided creating temporary lists for obtaining the first item.Sergey Fedoseev
2017-07-29Avoided creation of temporary sets.Sergey Fedoseev
2017-06-30Fixed #28350 -- Fixed UnboundLocalError crash in RenameField with ↵Simon Charette
nonexistent field. Thanks Tim for the review.
2017-06-28Fixed #27818 -- Replaced try/except/pass with contextlib.suppress().Mads Jensen