1
0
mirror of https://github.com/django/django.git synced 2025-03-21 14:50:45 +00:00
Tim Graham 098c07a032 Fixed , -- Made makemigrations consistency checks respect database routers.
Partially reverted refs  except for one of the tests as this
solution supersedes that one.

Thanks Shai Berger for the review.
2016-09-01 16:19:29 -04:00

14 lines
358 B
Python

class EmptyRouter(object):
pass
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