summaryrefslogtreecommitdiff
path: root/tests/migrations/test_executor.py
AgeCommit message (Collapse)Author
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
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-02-04Simplified imports from django.db and django.contrib.gis.db.Nick Pope
2019-03-07Refs #30186 -- Changed MigrationRecorder.applied_migrations() to return a dict.Tim Schilling
2018-11-27Switched TestCase to SimpleTestCase where possible in Django's tests.Tim Graham
2018-10-24Fixed #29721 -- Ensured migrations are applied and recorded atomically.Sanyam Khurana
2017-12-28Removed unnecessary trailing commas and spaces in various code.Mariusz Felisiak
2017-08-10Fixed #28386 -- Made operations within non-atomic migrations honor the ↵Evan Grim
operation's atomic flag when migrating backwards.
2017-01-19Refs #23919 -- Stopped inheriting from object to define new style classes.Simon Charette
2017-01-09Fixed test isolation in a couple migrations tests.Tim Graham
Without this, tests from refs #27432 fail when running with --reverse.
2016-11-10Refs #27392 -- Removed "Tests that", "Ensures that", etc. from test docstrings.za
2016-09-17Refs #27025 -- Fixed "invalid escape sequence" warnings in Python 3.6.Tim Graham
http://bugs.python.org/issue27364
2016-08-24Fixed #27044 -- Included already applied migration changes in the ↵Simon Charette
post-migrate state when the execution plan is empty. Refs #24100. Thanks tkhyn for the report and Tim for the review.
2016-06-16Fixed #26747 -- Used more specific assertions in the Django test suite.Jon Dufresne
2016-05-26Fixed #26647 -- Included the state of all applied migrations when migrating ↵Simon Charette
forward. Thanks Jasper Maes for the detailed report.
2016-02-05Fixed #25833 -- Added support for non-atomic migrations.Pankrat
Added the Migration.atomic attribute which can be set to False for non-atomic migrations.
2015-12-19Fixed #25922 -- Fixed migrate --fake-initial detection of many-to-many tables.Tim Graham
2015-09-19Fixed #24743, #24745 -- Optimized migration plan handlingMarkus Holtermann
The change partly goes back to the old behavior for forwards migrations which should reduce the amount of memory consumption (#24745). However, by the way the current state computation is done (there is no `state_backwards` on a migration class) this change cannot be applied to backwards migrations. Hence rolling back migrations still requires the precomputation and storage of the intermediate migration states. This improvement also implies that Django does not handle mixed migration plans anymore. Mixed plans consist of a list of migrations where some are being applied and others are being unapplied. Thanks Andrew Godwin, Josh Smeaton and Tim Graham for the review as well as everybody involved on the ticket that kept me looking into the issue.
2015-06-03Cleaned up docstring style, per Tim Graham review.Carl Meyer
2015-06-03Refs #24628 -- Added a second test and a docstring comment to avoid regression.Carl Meyer
2015-06-02Fixed #24628 -- Fixed applied status for squashed migrations.Carl Meyer
2015-02-16Refs #24264 -- Added failing test case for updating a FK when changing a PKMarkus Holtermann
When the primary key column is altered, foreign keys of referencing models must be aware of a possible data type change as well and thus need to be re-rendered. Thanks Tim Graham for the report.
2015-02-13Fixed #24184 -- Prevented automatic soft-apply of migrationsMarkus Holtermann
Previously Django only checked for the table name in CreateModel operations in initial migrations and faked the migration automatically. This led to various errors and unexpected behavior. The newly introduced --fake-initial flag to the migrate command must be passed to get the same behavior again. With this change Django will bail out in with a "duplicate relation / table" error instead. Thanks Carl Meyer and Tim Graham for the documentation update, report and review.
2015-02-06Sorted imports with isort; refs #23860.Tim Graham
2015-01-12Fixed #24129 -- Added indicator that migrations are rendering the initial stateMarkus Holtermann
Thanks Tim Graham for the review.
2015-01-12Fixed #24123 -- Used all available migrations to generate the initial ↵Markus Holtermann
migration state Thanks Collin Anderson for the input when creating the patch and Tim Graham for the review.
2015-01-02Fixed #23745 -- Reused states as much as possible in migrationsClaude Paroz
Thanks Tim Graham and Markus Holtermann for the reviews.
2015-01-02Passed around the state between migrationsClaude Paroz
Refs #23745.
2015-01-02Replaced migration state render() by apps cached propertyClaude Paroz
Refs #23745.
2014-11-19Added another migration-executor test to avoid regressions.Carl Meyer
2014-11-19Fixed #23410 -- Avoided unnecessary rollbacks in related apps when migrating ↵Carl Meyer
backwards.
2014-09-24Revert "Fixed #23474 -- Prevented migrating backwards from unapplying the ↵Tim Graham
wrong migrations." This reverts commit abcf28a07695a45cb5fb15b81bffc97bea5e0be3.
2014-09-23Called table_names instead of get_table_list in migrationsClaude Paroz
2014-09-19Fixed some flake8 errors.Tim Graham
Originally I added migrations to flake8 exclude because of long lines in migration files, but there are other directories named migrations we do want to check. We are not warning on line lengths yet anyway.
2014-09-15Fixed #23474 -- Prevented migrating backwards from unapplying the wrong ↵valtron
migrations.
2014-09-05Revert "Fixed #23384 -- Allowed overriding part of a dictionary-type setting"Claude Paroz
This reverts commit 66757fee7e921ad4c35e0b3f80c25e026100b31c. Discussions have led to think that this functionality does not bring significant benefits to justify the added complexity. Read also discussions on ticket #22734.
2014-08-30Fixed #23384 -- Allowed overriding part of a dictionary-type settingClaude Paroz
This change is needed for upcoming changes where settings might be grouped in a parent dictionary. Thanks Tim Graham for the review.
2014-07-25Fixed #23093: soft application detection for swapped modelsAndrew Godwin
2014-06-23Fixed #22881 -- Better soft_applied migration detectionChris Beaven
2014-06-16Removed usaged of contrib.sessions as a placeholder in migration tests.Tim Graham
Without this, we're unable to add actual migrations for the app.
2014-06-09Remove overzealous migration flushes from migration test suiteAndrew Godwin
2014-05-08Tests for #22325Andrew Godwin
2013-12-23Imported override_settings from its new location.Aymeric Augustin
2013-11-02Fixed #21302 -- Fixed unused imports and import *.Tim Graham
2013-10-30Fixed some flake8 issuesAlex Gaynor
2013-10-30Auto-apply initial migrations if their tables exist already.Andrew Godwin
2013-10-23Fix migration planner to fully understand squashed migrations. And test.Andrew Godwin
2013-08-23Fix some small errors in the testsAndrew Godwin
2013-08-11Fix weird planning issues when already fully migrated.Andrew Godwin