mirror of
https://github.com/django/django.git
synced 2025-08-31 15:57:45 +00:00
Fixed #24900 -- Allowed migrating backward to squashed migrations.
This commit is contained in:
parent
9e17cc062c
commit
3219dd3388
3 changed files with 46 additions and 0 deletions
|
@ -980,6 +980,19 @@ class MigrateTests(MigrationTestBase):
|
|||
# Unmigrate everything.
|
||||
call_command('migrate', 'migrations', 'zero', verbosity=0)
|
||||
|
||||
@override_settings(MIGRATION_MODULES={'migrations': 'migrations.test_migrations_squashed'})
|
||||
def test_migrate_backward_to_squashed_migration(self):
|
||||
try:
|
||||
call_command('migrate', 'migrations', '0001_squashed_0002', verbosity=0)
|
||||
self.assertTableExists('migrations_author')
|
||||
self.assertTableExists('migrations_book')
|
||||
call_command('migrate', 'migrations', '0001_initial', verbosity=0)
|
||||
self.assertTableExists('migrations_author')
|
||||
self.assertTableNotExists('migrations_book')
|
||||
finally:
|
||||
# Unmigrate everything.
|
||||
call_command('migrate', 'migrations', 'zero', verbosity=0)
|
||||
|
||||
@override_settings(MIGRATION_MODULES={'migrations': 'migrations.test_migrations'})
|
||||
def test_migrate_inconsistent_history(self):
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue