mirror of
https://github.com/django/django.git
synced 2025-08-30 23:37:50 +00:00
Fixed #27044 -- Included already applied migration changes in the post-migrate state when the execution plan is empty.
Refs #24100. Thanks tkhyn for the report and Tim for the review.
This commit is contained in:
parent
ad25fe7350
commit
d1757d8df4
5 changed files with 36 additions and 8 deletions
|
@ -168,6 +168,14 @@ class ExecutorTests(MigrationTestBase):
|
|||
("migrations2", "0001_initial"),
|
||||
])
|
||||
self.assertEqual(plan, [])
|
||||
# The resulting state should include applied migrations.
|
||||
state = executor.migrate([
|
||||
("migrations", "0002_second"),
|
||||
("migrations2", "0001_initial"),
|
||||
])
|
||||
self.assertIn(('migrations', 'book'), state.models)
|
||||
self.assertIn(('migrations', 'author'), state.models)
|
||||
self.assertIn(('migrations2', 'otherauthor'), state.models)
|
||||
# Erase all the fake records
|
||||
executor.recorder.record_unapplied("migrations2", "0001_initial")
|
||||
executor.recorder.record_unapplied("migrations", "0002_second")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue