summaryrefslogtreecommitdiff
path: root/tests/migrations
AgeCommit message (Collapse)Author
2021-01-26[3.2.x] Fixed #32369 -- Fixed adding check constraints with pattern lookups ↵Simon Charette
and expressions as rhs. This disables interpolation of constraint creation statements. Since Constraint.create_sql interpolates its parameters instead of deferring this responsibility to the backend connection it must disable connection level parameters interpolation. Backport of 42e8cf47c7ee2db238bf91197ea398126c546741 from master
2021-01-21[3.2.x] Fixed #32374 -- Stopped recording migration application before ↵Simon Charette
deferred SQL. Migrations cannot be recorded in the same transaction as its associated DDL operations when some of it is deferred until the schema editor context exits. Regression in c86a3d80a25acd1887319198ca21a84c451014ad. Backport of 0c42cdf0d2422f4c080e93594d5d15381d6e955e from master
2021-01-21[3.2.x] Refs #29721 -- Simplified migration used to test atomic recording.Simon Charette
This makes sure atomic recording of migration application is used when the schema editor doesn't defer any statement. Backport of 533a5835784b95335c8373b6d0b9495b3834e96e from master
2021-01-13Fixed #26167 -- Added support for functional indexes.Hannes Ljungberg
Thanks Simon Charette, Mads Jensen, and Mariusz Felisiak for reviews. Co-authored-by: Markus Holtermann <info@markusholtermann.eu>
2020-12-31Fixed #31413 -- Fixed isolation of migrations.test_loader on databases that ↵Hasan Ramezani
don't support transactions.
2020-12-29Fixed #32302 -- Allowed migrations to be loaded from regular packages with ↵William Schwartz
no __file__ attribute. The migrations loader prevents the use of PEP-420 namespace packages for holding apps' migrations modules. Previously the loader tested for this only by checking that app.migrations.__file__ is present. This prevented migrations' being found in frozen Python environments that don't set __file__ on any modules. Now the loader *additionally* checks whether app.migrations.__path__ is a list because namespace packages use a different type for __path__. Namespace packages continue to be forbidden, and, in fact, users of normal Python environments should experience no change whatsoever.
2020-12-23Fixed isolation of test_migrate_fake_split_initial.Mariusz Felisiak
2020-12-18Fixed #32262 -- Fixed migration optimization for model creation and Meta ↵Hasan Ramezani
options removal.
2020-11-07Removed hardcoded pks in migrations' test_alter_order_with_respect_to.Tim Graham
2020-09-04Fixed #27417 -- Made RenameField operation a noop for field name case ↵Mariusz Felisiak
changes on Oracle. Field names are always uppercased in the Oracle backend. Changing case should be a noop to avoid database errors: "ORA-00957: duplicate column name".
2020-08-28Fixed #31954 -- Fixed migration optimization for MTI model creation with ↵Koen De Wit
parent model with mixed case app label.
2020-08-14Fixed #31826 -- Made AlterField operation a noop when adding db_column.Iuri de Silvio
AlterField operation with adding a db_column is a noop if the column name is not changed.
2020-08-13Fixed #31825 -- Made RenameField operation a noop for fields with db_column.Iuri de Silvio
2020-08-08Fixed #31831 -- Fixed migration operations ordering when adding ↵Iuri de Silvio
order_with_respect_to and constraints/indexes.
2020-08-08Refs #31831 -- Added autodector test for unique/index_together on _order field.Iuri de Silvio
2020-07-22Reverted "Fixed #30300 -- Allowed migrations to be loaded from directories ↵Tim Graham
without __init__.py file." This reverts commit 3cd3bebe8921e14b911b36b2a1cbceef8fb6294e.
2020-07-20Fixed #31769 -- Improved default naming of merged migrations.Jon Dufresne
47 gives 60 in total (47 + 5 + 5 + 3).
2020-07-10Sorted conflicting migrations by names.François Freitag
2020-06-26Fixed #31742 -- Fixed makemigrations crash on ForeignKey to an app with ↵Mariusz Felisiak
mixed case label. Regression in 9e1b6b8a66af4c2197e5b1b41eb9dbb36e4f6502. Thanks Ignacio Santolin for the report.
2020-06-24Fixed #31529 -- Added support for serialization of pathlib.Path/PurePath and ↵Nick Pope
os.PathLike in migrations.
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 -- Added Migration.suggest_name() test for initial migration ↵Jon Dufresne
with multiple CreateModels.
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.
2020-06-12Fixed #31645 -- Enhanced the migration warning for migrate commmand.Chinmoy Chakraborty
Added the list of apps with changes not reflected in migrations.
2020-06-08Fixed #31661 -- Removed period in makemigrations history check warning.davidchorpash
2020-06-04Fixed #30913 -- Added support for covering indexes on PostgreSQL 11+.Hannes Ljungberg
2020-05-28Fixed #31468 -- Allowed specifying migration filename in Operation.Adam Johnson
This adds also suggested filename for many built-in operations.
2020-05-28Refs #31468 -- Added tests for MigrationAutodetector.suggest_name().Adam Johnson
2020-05-28Fixed isolation of test_migrate_fake_initial.Mariusz Felisiak
2020-05-26Fixed #31416 -- Made autodetector find dependencies for MTI model creation ↵Nan Liu
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.
2020-05-19Fixed #31504 -- Allowed calling makemigrations without an active database ↵wtkm11
connection.
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.