Re: Running migrations with multiple databases

2023-07-11 Thread shahee...@gmail.com
Thanks: just what I needed to know! On Tuesday, 11 July 2023 at 02:48:48 UTC+1 David Nugent wrote: Migrations are executed according to how your db routers is setup. See setting DATABASE_ROUTERS. Note that normally you would be replicating secondaries, so migrations are normally not applied on

Re: Running migrations with multiple databases

2023-07-10 Thread David Nugent
Migrations are executed according to how your db routers is setup. See setting DATABASE_ROUTERS. Note that normally you would be replicating secondaries, so migrations are normally not applied on all bu the primary, so this is the default. Regards, David On Mon, Jul 10, 2023 at 10:26 PM Shaheed

Running migrations with multiple databases

2023-07-10 Thread Shaheed Haque
Hi, I'm on Django 4.2 atop Postgres. In my project settings.py, I have a main/default database connection, and a second set up like this: == DATABASES = { 'default': { ... 'NAME': 'foo', # Postgres DATABASE NAME ... }, 'archive_r

Re: Migrations with multiple databases

2016-10-27 Thread marcin . j . nowak
On Tuesday, October 25, 2016 at 5:05:46 PM UTC+2, andrea crotti wrote: > > We have a couple of databases with a tiny number of tables, but > django-migrations has still go through all the migrations anyway. > So even if the SQL itself is nothing it still takes a massive amount of > time and mem

Re: Migrations with multiple databases

2016-10-27 Thread andrea crotti
Ah nice thanks Markus, however - different subsets of INSTALLED_APPS sounds a bit hacky, how would I do it anyway? checking in the settings which database is being migrated and providing a different list? Or any other way? - MIGRATION_MODULES sounds a bit safer, but I'm not sure it gives t

Re: Migrations with multiple databases

2016-10-25 Thread Markus Holtermann
Hi Andrea, If you have models that are entirely unrelated in different databases you could use different values for INSTALLED_APPS to limit the apps Django sees or by settings the values in the MIGRATION_MODULES dict to None to tell Django that those apps don't have migrations. Cheers, /Markus

Migrations with multiple databases

2016-10-25 Thread andrea crotti
We have a couple of databases with a tiny number of tables, but django-migrations has still go through all the migrations anyway. So even if the SQL itself is nothing it still takes a massive amount of time and memory for the usual known issues with migrations on big projects. I guess it works t