Django 2.2.18
I want to split the models of one app to a second database. The relevant app is named "dear_zoho_analytics", which I assume is the 'app_label'. The original database is "default".
I have only one dbrouter, and it has code like this:
class DbRouter(object):
route_app_labels = ["dear_zoho_analytics", ]
def db_for_read(self, model, **hints):
.
.
.
def allow_migrate(self, db, app_label, model_name=None, **hints):
if app_label in self.route_app_labels:
return db == "dear_analytics"
return None
when I do this:
python3 ./manage.py migrate --database=dear_analytics
I get the tables of every app created in the new database.
python3 ./manage.py migrate dear_zoho_analytics --database=dear_analytics
does what I want. However, this sort of implies that my allow migrate is not working because it appears to do nothing useful.