summaryrefslogtreecommitdiff
path: root/tests/migrations
AgeCommit message (Collapse)Author
2022-06-02[4.1.x] Fixed #31788 -- Fixed migration optimization after altering field to ↵David Wobrock
ManyToManyField. This makes AddField() used for altering to ManyToManyField, dependent on the prior RemoveField. Backport of 798b6c23ee52c675dd0f0e233c50cddd7ff15657 from main
2022-05-26[4.1.x] Fixed #23740 -- Fixed removing unique_together constraint if exists ↵David Wobrock
primary key/unique constraint on the same field. Backport of b949e40e8c32a393f480399e2d70b653108098b6 from main
2022-05-17Refs #27064 -- Made migrations generate RenameIndex operations when moving ↵David Wobrock
indexes from index_together to Meta.indexes.
2022-05-16Refs #27064 -- Made migrations generate RenameIndex operations when renaming ↵David Wobrock
Meta.indexes.
2022-05-16Fixed #33710 -- Made RenameIndex operation a noop when the old and new name ↵David Wobrock
match.
2022-05-12Refs #27064 -- Added RenameIndex migration operation.David Wobrock
2022-05-05Refs #30581 -- Moved CheckConstraint tests for conditional expressions to ↵Mariusz Felisiak
migrations.test_operations. This allows avoiding warning in tests about using RawSQL in CheckConstraints.
2022-05-02Fixed #33413 -- Made migrations propage collations to related fields.David Wobrock
2022-04-21Fixed #33509 -- Added "(no-op)" to sqlmigrate output for operations without ↵Adam Johnson
SQL statement.
2022-04-21Refs #33509 -- Made sqlmigrate tests stricter and improved isolation.Adam Johnson
2022-04-13Fixed tests on databases that don't support introspecting foreign keys.Mariusz Felisiak
2022-04-04Fixed #33605 -- Fixed migration crash when altering RegexValidator to ↵Brian Helba
pre-compiled regular expression.
2022-03-29Refs #32365 -- Deprecated django.utils.timezone.utc.Carlton Gibson
2022-03-24Refs #32365 -- Removed internal uses of utils.timezone.utc alias.Carlton Gibson
Remaining test case ensures that uses of the alias are mapped canonically by the migration writer.
2022-03-23Refs #32365 -- Made migration writer use datetime.timezone.utc.Carlton Gibson
2022-03-11Fixed #33572 -- Implemented CreateModel/AlterModelManagers reduction.Adam Johnson
2022-02-23Refs #33476 -- Added warning to optimizemigration/squashmigrations commands ↵Mariusz Felisiak
when black cannot be applied.
2022-02-22Fixed #27844 -- Added optimizemigration management command.David Wobrock
2022-02-16Fixed #33515 -- Prevented recreation of migration for ManyToManyField to ↵Mariusz Felisiak
lowercased swappable setting. Thanks Chris Lee for the report. Regression in 43289707809c814a70f0db38ca4f82f35f43dbfd. Refs #23916.
2022-02-11Refs #33476 -- Made management commands use black.Carlton Gibson
Run black on generated files, if it is available on PATH.
2022-02-07Refs #33476 -- Refactored code to strictly match 88 characters line length.Mariusz Felisiak
2022-02-07Refs #33476 -- Reformatted code with Black.django-bot
2022-02-03Refs #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], )
2022-02-01Fixed #33480 -- Fixed makemigrations crash when renaming field of renamed model.Kirill Safronov
Regression in aa4acc164d1247c0de515c959f7b09648b57dc42.
2022-01-27Fixed #33462 -- Fixed migration crash when altering type of primary key with ↵Mariusz Felisiak
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.
2022-01-21Fixed #26760 -- Added --prune option to migrate command.Jacob Walls
2022-01-21Fixed #33449 -- Fixed makemigrations crash on models without ↵Fabian Büchler
Meta.order_with_respect_to but with _order field. Regression in aa4acc164d1247c0de515c959f7b09648b57dc42.
2022-01-10Fixed #29026 -- Added --scriptable option to makemigrations.Jacob Walls
2022-01-07Fixed #33216 -- Simpilified deconstructed paths for some expressions.Allen Jonathan David
2022-01-04Fixed #33402 -- Optimized multiple AlterFooTogether operations.David Wobrock
2022-01-03Refs #29026 -- Allowed customizing InteractiveMigrationQuestioner's prompt ↵Jacob Walls
destination. Previously, the questioner did not obey the value of stdout provided to the command.
2021-12-30Fixed #23273 -- Avoided creation of django_migrations table when there are ↵Jacob Walls
no migrations to apply.
2021-12-27Refs #22983 -- Added tests for squashing migrations with functions from ↵Mariusz Felisiak
migration files. Follow up to ebb13bbd884d8c3053d1d342ef0423240feb05e6.
2021-12-20Removed a Python error message dependency in ↵Jacob Walls
test_questioner_no_default_bad_user_entry_code().
2021-12-20Increased test coverage of django.db.migrations.questioner.Jacob Walls
2021-12-17Fixed #33366 -- Fixed case handling with swappable setting detection in ↵Simon Charette
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.
2021-11-22Fixed #33305 -- Fixed autodetector crash for ForeignKey with hardcoded "to" ↵Baptiste Mispelon
attribute. Co-authored-by: Simon Charette <charette.s@gmail.com>
2021-11-02Fixed #33234 -- Fixed autodetector crash for proxy models inheriting from ↵Mariusz Felisiak
non-model class. Regression in aa4acc164d1247c0de515c959f7b09648b57dc42. Thanks Kevin Marsh for the report.
2021-11-02Fixed #33246 -- Made squashmigrations raise CommandError when squashed_name ↵andrewdotn
already exists.
2021-10-27Fixed #33201 -- Made RenameModel operation a noop for models with db_table.Iuri de Silvio
2021-10-26Corrected AutodetectorTests.test_rename_field_and_foo_together()'s docstring.Mariusz Felisiak
2021-10-25Fixed #31503 -- Made autodetector remove unique/index_together before ↵David Wobrock
altering fields.
2021-10-19Fixed #33197 -- Made field rename with prior matching db_column change a noop.Simon Charette
Thanks Jacob Walls for the report.
2021-10-18Fixed #33194 -- Fixed migrations when altering a field with functional ↵Hannes Ljungberg
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>
2021-10-15Fixed #23953 -- Made makemigrations continue number sequence for squashed ↵Jacob Walls
migrations.
2021-10-15Refs #23953 -- Added MigrationAutodetector.parse_number() tests.Jacob Walls
2021-10-12Fixed #29470 -- Logged makemigrations automatic decisions in non-interactive ↵Jacob Walls
mode.
2021-10-12Refs #29470 -- Added makemigrations test for adding fields with no default ↵Jacob Walls
and auto_now_add=True in non-interactive mode.
2021-10-08Fixed #33022 -- Fixed isolation of ↵Mariusz Felisiak
migrations.test_executor.ExecutorTests.test_custom_user().
2021-10-06Fixed #23408 -- Added migrations questioner prompt for adding unique fields ↵Jacob Walls
with a callable default.