Fixed #26117 -- Consulted database routers in initial migration detection.

Thanks Simon Charette for help.
This commit is contained in:
Scott Sexton 2016-01-24 18:23:38 -06:00 committed by Tim Graham
parent 1f8cfcf3b4
commit fc584f0685
5 changed files with 93 additions and 45 deletions

View 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