summaryrefslogtreecommitdiff
path: root/tests/migrations
AgeCommit message (Collapse)Author
2021-08-11Refs #29898 -- Changed ProjectState.real_apps to set.Mariusz Felisiak
2021-08-04Fixed #29063 -- Fixed migrate crash when specifying a name of partially ↵Jacob Walls
applied squashed migrations.
2021-08-04Fixed typos in migrations tests, comments, and error message.Jacob Walls
2021-08-04Used assertRaisesMessage() to test ↵Mariusz Felisiak
MigrationLoader.get_migration_by_prefix()'s error messages.
2021-07-27Refs #32956 -- Changed "afterwards" to "afterward" in docs and comments.David Smith
This also removes unnecessary comments with the previous spelling. AP Stylebook has a short entry to advise the preferred spelling for "en-us". "Afterwards" is preferred in British English.
2021-07-27Refs #32743 -- Fixed recreation of foreign key constraints when altering ↵Jordan Bae
type of referenced primary key with MTI. Follow up to 325d7710ce9f6155bb55610ad6b4580d31263557.
2021-07-26Fixed #32743 -- Added foreign key altering when altering type of referenced ↵David Wobrock
primary key with MTI.
2021-07-01Fixed #32893 -- Fixed serialization of models.Model class in migrations.abhiabhi94
Migrations assumed that an import of the models.Model class must already be included when it's serialized, but for models with only custom fields this was not necessarily the case. Thanks Jaap Joris Vens for the report.
2021-06-11Fixed #25250 -- Clarified partially recorded state of squashed migrations in ↵Jacob Walls
showmigrations --list.
2021-06-08Fixed #25255 -- Recorded unapplied squashed migrations.Jacob Walls
2021-06-07Fixed typos in test comments.luzpaz
2021-06-07Fixed #32821 -- Updated os.scandir() uses to use a context manager.Chris Jerdonek
2021-05-25Fixed #32780 -- Made Add/RemoveConstraint operations a noop for ↵Hannes Ljungberg
covering/deferrable unique constraints on SQLite.
2021-05-12Fixed #32366 -- Updated datetime module usage to recommended approach.Nick Pope
- Replaced datetime.utcnow() with datetime.now(). - Replaced datetime.utcfromtimestamp() with datetime.fromtimestamp(). - Replaced datetime.utctimetuple() with datetime.timetuple(). - Replaced calendar.timegm() and datetime.utctimetuple() with datetime.timestamp().
2021-05-12Added extra assertion to ↵Nick Pope
migrations.test_writer.WriterTests.test_serialize_datetime. This checks that datetime.timezone.utc serializes correctly.
2021-04-27Fixed #32686 -- Removed unnecessary semicolon on collected multiline SQL for ↵Hannes Ljungberg
RunSQL.
2021-04-27Refs #32686 -- Added tests for adding a semicolon when collecting SQL for ↵Hannes Ljungberg
RunSQL.
2021-04-23Fixed isolation of test_showmigrations_unmigrated_app().Mariusz Felisiak
Follow up to 90916f050c64b817fdf2ea13b5c20986005fd029.
2021-04-22Fixed isolation of test_showmigrations_unmigrated_app().Mariusz Felisiak
2021-04-16Fixed #29899 -- Made autodetector use model states instead of model classes.David Wobrock
Thanks Simon Charette and Markus Holtermann for reviews.
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 -- Added Migration.suggest_name() tests for migrations with no ↵Adam Johnson
operations.
2021-03-12Refs #31516, Refs #31703 -- Made makemigrations always name initial ↵Adam Johnson
migrations "initial".
2021-02-23Fixed #30916 -- Added support for functional unique constraints.Hannes Ljungberg
Thanks Ian Foote and Mariusz Felisiak for reviews.
2021-02-19Fixed #32458 -- Made __repr__() for Index and BaseConstraint subclasses more ↵Hannes Ljungberg
consistent.
2021-02-19Fixed #32256 -- Fixed migration optimization crash when swapping field names.Hasan Ramezani
This disables optimization of RenameField operation when an old field name is referenced in subsequent operations. Co-authored-by: InvalidInterrupt <InvalidInterrupt@users.noreply.github.com>
2021-02-04Fixed #32350 -- Fixed showmigrations crash for applied squashed migrations.Daniel Ebrahimian
Thanks Simon Charette for reviews.
2021-02-04Fixed #32395 -- Allowed capturing stdout of migration signals.Simon Charette
2021-01-26Fixed #32369 -- Fixed adding check constraints with pattern lookups and ↵Simon Charette
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.
2021-01-21Fixed #32374 -- Stopped recording migration application before deferred SQL.Simon Charette
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.
2021-01-21Refs #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.
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.