mirror of
https://github.com/django/django.git
synced 2025-08-03 10:34:04 +00:00
Fixed #26117 -- Consulted database routers in initial migration detection.
Thanks Simon Charette for help.
This commit is contained in:
parent
1f8cfcf3b4
commit
fc584f0685
5 changed files with 93 additions and 45 deletions
9
tests/migrations/routers.py
Normal file
9
tests/migrations/routers.py
Normal file
|
@ -0,0 +1,9 @@
|
|||
class TestRouter(object):
|
||||
def allow_migrate(self, db, app_label, model_name=None, **hints):
|
||||
"""
|
||||
The Tribble model should be the only one to appear in the 'other' db.
|
||||
"""
|
||||
if model_name == 'tribble':
|
||||
return db == 'other'
|
||||
elif db == 'other':
|
||||
return False
|
Loading…
Add table
Add a link
Reference in a new issue