summaryrefslogtreecommitdiff
path: root/tests/migrations
AgeCommit message (Collapse)Author
2020-07-22[3.1.x] Reverted "Fixed #30300 -- Allowed migrations to be loaded from ↵Tim Graham
directories without __init__.py file." This reverts commit 3cd3bebe8921e14b911b36b2a1cbceef8fb6294e. Backport of ff55adbd0da6618abaf265d16196bf54f81aa77a from master
2020-06-26[3.1.x] Fixed #31742 -- Fixed makemigrations crash on ForeignKey to an app ↵Mariusz Felisiak
with mixed case label. Regression in 9e1b6b8a66af4c2197e5b1b41eb9dbb36e4f6502. Thanks Ignacio Santolin for the report. Backport of 62d85a283500e9abb0e1c9ec53c59be468f056a0 from master
2020-05-28[3.1.x] Fixed isolation of test_migrate_fake_initial.Mariusz Felisiak
Backport of 42de52affe20e399554d984cc7848bf8e0368b41 from master
2020-05-26[3.1.x] Fixed #31416 -- Made autodetector find dependencies for MTI model ↵Nan Liu
creation on base fields removal. Removing a base field must take place before adding a new inherited model that has a field with the same name. Backport of 33c365781abbcc1b21a31b31d95d344a174df0d5 from master
2020-04-30Fixed #20581 -- Added support for deferrable unique constraints.Ian Foote
2020-04-28Added test for squashmigrations' output.François Freitag
2020-04-27Removed unnecessary capturing/hiding of stdout/stderr in various tests.François Freitag
2020-04-27Disabled management commands output with verbosity 0 in ↵François Freitag
test_regression_22823_unmigrated_fk_to_migrated_model.
2020-04-25Removed unnecessary capturing of stdout in ↵François Freitag
test_makemigrations_non_interactive_not_null_addition.
2020-04-23Fixed #29224 -- Fixed removing index_together indexes if exists ↵David Wobrock
unique_together constraint on the same fields.
2020-04-22Fixed #31499 -- Stored ModelState.fields into a dict.Simon Charette
This allows the removal of its O(n) .get_field_by_name method and many other awkward access patterns. While fields were initially stored in a list to preserve the initial model definiton field ordering the auto-detector doesn't take field ordering into account and no operations exists to reorder fields of a model. This makes the preservation of the field ordering completely superflous because field reorganization after the creation of the model state wouldn't be taken into account.
2020-04-22Refs #31499 -- Ignored field ordering to determine ModelState equality.Simon Charette
2020-04-21Refs #30591 -- Adjusted table rebuild for non-pk relationship on SQLite.Simon Charette
The existing code was only accounting for primary key changes and not all unique key fields that can be referenced.
2020-04-21Fixed #31064 -- Recreated auto-created many-to-many tables on primary key ↵Simon Charette
data type change on SQLite. Both local and remote auto-created many-to-many relationships were affected.
2020-04-21Removed redundant import in tests/migrations/test_operations.py.Simon Charette
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.
2020-04-08Refs #30966 -- Added test for reloading related model state on ↵Mariusz Felisiak
non-relational changes. Thanks Markus Holtermann for initial test. Fixed in 1d16c5d562a67625f7309cc7765b8c57d49bf182.
2020-04-07Refs #27666 -- Ensured relationship consistency on delayed reloads.Simon Charette
Delayed reloads of state models broke identity based relationships between direct and non-direct ancestors. Basing models.Options related objects map of model labels instead of their identity ensured relationship consistency is maintained. Refs #30966. Co-authored-by: Hasan Ramezani <hasan.r67@gmail.com>
2020-03-26Fixed #31402 -- Added migrate --check option.Gordon Pendleton
Command exits with non-zero status if unapplied migrations exist.
2020-03-25Fixed #23916 -- Allowed makemigrations to handle related model name case ↵Adam Johnson
changes. Made autodetector ignore related model name case changes so unnecessary migrations are not created.
2020-03-09Fixed #31318 -- Allowed sqlmigrate to inspect squashed migrations.David Wobrock
2020-03-09Refs #31318 -- Added tests for inspecting squashed migrations and ambiguous ↵David Wobrock
names in sqlmigrate.
2020-02-04Simplified imports from django.db and django.contrib.gis.db.Nick Pope
2020-01-23Refs #31197 -- Added tests for combined expressions in CheckConstraint.check.Mariusz Felisiak
Thanks Adam Johnson for the report. Fixed in 306b6875209cfedce2536a6679e69adee7c9bc6a.
2020-01-20Refs #31117 -- Made various tests properly handle unexpected databases aliases.Matthijs Kooijman
- Used selected "databases" instead of django.db.connections. - Made routers in tests.migrations skip migrations on unexpected databases. - Added DiscoverRunnerGetDatabasesTests.assertSkippedDatabases() hook which properly asserts messages about skipped databases.
2020-01-16Fixed #29998 -- Allowed multiple OneToOneFields to the parent model.Mariusz Felisiak
We assumed that any OneToOneField's in a child model must be the parent link and raised an error when parent_link=True was not specified. This patch allows to specify multiple OneToOneField's to the parent model. OneToOneField's without a custom related_name will raise fields.E304 and fields.E305 so this should warn users when they try to override the auto-created OneToOneField.
2019-11-25Fixed #27914 -- Fixed serialization of nested classes in migrations.John Bowen
2019-11-25Refs #23950 --- Moved test DeconstructibleInstances class to a module level.John Bowen
DeconstructibleInstances was not importable from the asserted path.
2019-11-18Removed unnecessary parentheses in various code.Jon Dufresne
2019-11-15Refs #29808 -- Fixed ↵Mariusz Felisiak
MigrateTests.test_migrate_fake_initial_case_insensitive() crash on Oracle.
2019-11-15Fixed #29808 -- Fixed initial migration detection when identifiers are ↵Hasan Ramezani
case-insensitive. Thanks Simon Charette for the review.
2019-10-29Used more specific unittest assertions in tests.Nick Pope
* assertIsNone()/assertIsNotNone() instead of comparing to None. * assertLess() for < comparisons. * assertIs() for 'is' expressions. * assertIsInstance() for isinstance() expressions. * rounding of assertAlmostEqual() for round() expressions. * assertIs(..., True/False) instead of comparing to True/False. * assertIs()/assertIsNot() for ==/!= comparisons. * assertNotEqual() for == comparisons. * assertTrue()/assertFalse() instead of comparing to True/False.
2019-10-14Fixed #30870 -- Fixed showing that RunPython operations are irreversible by ↵Mariusz Felisiak
migrate --plan. Thanks Hasan Ramezani for the initial patch and Kyle Dickerson for the report.
2019-10-14Isolated migrations.test_commands.MigrateTests.test_migrate_plan.Mariusz Felisiak
2019-10-14Fixed #30868 -- Prevented unnecessary AlterField when renaming a referenced pk.Simon Charette
Regression introduced by dcdd219ee1, refs #25817. Thanks Carlos E. C. Leite for the report and Mariusz for the bisect.
2019-10-10Fixed #30300 -- Allowed migrations to be loaded from directories without ↵Benjy Weinberger
__init__.py file.
2019-10-03Refs #27914 -- Fixed serialization of nested enum.Enum classes in migrations.Hasan Ramezani
2019-10-03Refs #27914 -- Moved test enum.Enum subclasses outside of ↵Hasan Ramezani
WriterTests.test_serialize_enums().
2019-09-30Fixed #30774 -- Made serialization in migrations use members names for Enums.Hasan Ramezani
2019-09-11Refs #30591 -- Fixed too long identifier crash in migrations.test_operations ↵Mariusz Felisiak
on MySQL 8.0.16+.
2019-09-11Fixed #30591 -- Fixed recreation of foreign key constraints on MySQL when ↵Adnan Umer
altering type of referenced unique field. Thanks Mariusz Felisiak for tests and Matthijs Kooijman for investigation and initial patch.
2019-09-04Fixed #27910 -- Added enumeration helpers for use in Field.choices.Shai Berger
These classes can serve as a base class for user enums, supporting translatable human-readable names, or names automatically inferred from the enum member name. Additional properties make it easy to access the list of names, values and display labels. Thanks to the following for ideas and reviews: Carlton Gibson, Fran Hrženjak, Ian Foote, Mariusz Felisiak, Shai Berger. Co-authored-by: Shai Berger <shai@platonix.com> Co-authored-by: Nick Pope <nick.pope@flightdataservices.com> Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2019-09-03Fixed #30691 -- Made migrations autodetector find dependencies for foreign ↵Viktor Lomakin
keys altering.
2019-08-21Fixed #21039 -- Added AddIndexConcurrently/RemoveIndexConcurrently ↵Mads Jensen
operations for PostgreSQL. Thanks to Simon Charettes for review. Co-Authored-By: Daniel Tao <daniel.tao@gmail.com>
2019-08-19Moved migrations.test_operations.OperationTestBase to migrations.test_base.Mads Jensen
Co-Authored-By: Daniel Tao <daniel.tao@gmail.com>
2019-08-07Corrected several typos in string literals and test names.Min ho Kim
2019-08-02Fixed #30661 -- Added models.SmallAutoField.Nick Pope
2019-07-08Changed django.db.models.indexes.Index imports to django.db.models.Index.Mariusz Felisiak
2019-07-01Fixed #30595 -- Added error message when no objects found to sql* management ↵Hasan Ramezani
commands.