Re: DB Router default issue

2020-07-14 Thread Roger Gammans
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

Re: DB Router default issue

2020-07-14 Thread JJ Zolper
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

DB Router default issue

2020-07-10 Thread JJ Zolper
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 = '

DB Router default issue

2020-07-10 Thread JJ Zolper
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 = '