summaryrefslogtreecommitdiff
path: root/tests/migrations
AgeCommit message (Collapse)Author
2022-02-16[4.0.x] Fixed #33515 -- Prevented recreation of migration for ↵Mariusz Felisiak
ManyToManyField to lowercased swappable setting. Thanks Chris Lee for the report. Regression in 43289707809c814a70f0db38ca4f82f35f43dbfd. Refs #23916. Backport of 1e2e1be02bdf0fe4add0d0279dbca1d74ae28ad7 from main
2022-02-08[4.0.x] Refs #33476 -- Refactored code to strictly match 88 characters line ↵Mariusz Felisiak
length. Backport of 7119f40c9881666b6f9b5cf7df09ee1d21cc8344 from main.
2022-02-08[4.0.x] Refs #33476 -- Reformatted code with Black.django-bot
Backport of 9c19aff7c7561e3a82978a272ecdaad40dda5c00 from main.
2022-02-03[4.0.x] Refs #33476 -- Refactored problematic code before reformatting by Black.Mariusz Felisiak
In these cases Black produces unexpected results, e.g. def make_random_password( self, length=10, allowed_chars='abcdefghjkmnpqrstuvwxyz' 'ABCDEFGHJKLMNPQRSTUVWXYZ' '23456789', ): or cursor.execute(""" SELECT ... """, [table name], ) Backport of c5cd8783825b5f6384417dac5f3889b4210b7d08 from main.
2022-02-01[4.0.x] Fixed #33480 -- Fixed makemigrations crash when renaming field of ↵Kirill Safronov
renamed model. Regression in aa4acc164d1247c0de515c959f7b09648b57dc42. Backport of 97a72744681d0993b50dee952cf32cdf9650ad9f from main
2022-01-27[4.0.x] Fixed #33462 -- Fixed migration crash when altering type of primary ↵Mariusz Felisiak
key with MTI and foreign key. This prevents duplicated operations when altering type of primary key with MTI and foreign key. Previously, a foreign key to the base model was added twice, once directly and once by the inheritance model. Thanks bcail for the report. Regression in 325d7710ce9f6155bb55610ad6b4580d31263557. Backport of e972620ada4f9ed7bc57f28e133e85c85b0a7b20 from main
2022-01-21[4.0.x] Fixed #33449 -- Fixed makemigrations crash on models without ↵Fabian Büchler
Meta.order_with_respect_to but with _order field. Regression in aa4acc164d1247c0de515c959f7b09648b57dc42. Backport of eeff1787b0aa23016e4844c0f537d5093a95a356 from main
2021-12-17[4.0.x] Fixed #33366 -- Fixed case handling with swappable setting detection ↵Simon Charette
in migrations autodetector. The migration framework uniquely identifies models by case insensitive labels composed of their app label and model names and so does the app registry in most of its methods (e.g. AppConfig.get_model) but it wasn't the case for get_swappable_settings_name() until this change. This likely slipped under the radar for so long and only regressed in b9df2b74b98b4d63933e8061d3cfc1f6f39eb747 because prior to the changes related to the usage of model states instead of rendered models in the auto-detector the exact value settings value was never going through a case folding hoop. Thanks Andrew Chen Wang for the report and Keryn Knight for the investigation. Backport of 43289707809c814a70f0db38ca4f82f35f43dbfd from main
2021-11-02[4.0.x] Fixed #33234 -- Fixed autodetector crash for proxy models inheriting ↵Mariusz Felisiak
from non-model class. Regression in aa4acc164d1247c0de515c959f7b09648b57dc42. Thanks Kevin Marsh for the report. Backport of dab48b7482295956973879d15bfd4d3bb0718772 from main
2021-10-25[4.0.x] Fixed #31503 -- Made autodetector remove unique/index_together ↵David Wobrock
before altering fields. Backport of 0314593fe8e7dc685bbb6585eee40e755588864e from main
2021-10-18[4.0.x] Fixed #33194 -- Fixed migrations when altering a field with ↵Hannes Ljungberg
functional indexes/unique constraints on SQLite. This adjusts Expressions.rename_table_references() to only update alias when needed. Regression in 83fcfc9ec8610540948815e127101f1206562ead. Co-authored-by: Simon Charette <charettes@users.noreply.github.com> Backport of 86971c40909430a798e4e55b140004c4b1fb02ff from main
2021-09-20Refs #33119 -- Added tests for changing model name case referenced by ↵AliGhotbizadeh
ManyToManyField. Fixed in aa4acc164d1247c0de515c959f7b09648b57dc42.
2021-09-16Fixed #32365 -- Made zoneinfo the default timezone implementation.Carlton Gibson
Thanks to Adam Johnson, Aymeric Augustin, David Smith, Mariusz Felisiak, Nick Pope, and Paul Ganssle for reviews.
2021-08-31Fixed #33057 -- Fixed recreation of foreign key constraints in m2m tables ↵Mariusz Felisiak
when altering type of referenced primary key on Oracle.
2021-08-30Fixed #24900 -- Allowed migrating backward to squashed migrations.Jacob Walls
2021-08-30Refs #24900 -- Added MigrationLoader test for applying squashed migrations.Jacob Walls
2021-08-27Fixed #32900 -- Improved migrations questioner prompts.Mateo Radman
2021-08-27Refs #32900 -- Added makemigrations tests for messages in interactive mode.Mateo Radman
2021-08-27Refs #32900 -- Added test for ignoring the default value in ↵Mateo Radman
InteractiveMigrationQuestioner.ask_not_null_alteration().
2021-08-26Refs #29898 -- Changed fields in ProjectState's relation registry to dict.Mariusz Felisiak
2021-08-25Refs #29898 -- Made ProjectState encapsulate alterations in relations registry.Manav Agarwal
Thanks Simon Charette and Chris Jerdonek for reviews. Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2021-08-19Fixed #33014 -- Made ProjectState raise exception when real_apps argument is ↵Chris Jerdonek
not a set.
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