In allow_migrate () where you have 'return False', I've ended up (in my
otherwise very similar router) with:
return db != 'mydb'
You certainly don't want return False as that will disable all
migrations outside of your app_label, you want to return True,only in
the cases when the db is not
Has anyone experienced this same thing? Anyone have a lot of experience
working with multiple databases using a router? It's just a little unclear
how I'm supposed to better control it.
On Friday, July 10, 2020 at 12:03:46 PM UTC-4, JJ Zolper wrote:
>
> Hello, I am trying to prevent models in my
Hello, I am trying to prevent models in my api app from migrating into the
default database but I'm confused about the router. It seems every time I run
migrate even with the router it continues to migrate.
#apps.py
from django.apps import AppConfig
class ApiConfig(AppConfig):
name = '
Hello, I am trying to prevent models in my api app from migrating into the
default database but I'm confused about the router. It seems every time I run
migrate even with the router it continues to migrate.
#apps.py
from django.apps import AppConfig
class ApiConfig(AppConfig):
name = '
4 matches
Mail list logo