I'm using this package for quite some time. We encountered a use case in which we have to introduce a new database. Adding a new schema won't suffice so we added another DB with multi-tenancy. Therefore, having two databases operating on a semi-isolated approach. Now, I'm facing an issue regarding the migration of a particular schema in the non-default database.
Initially, I ran this command: python manage.py migrate_schemas --database=non_default. It creates necessary tables in the public schema
Now, when I'm trying to do: python manage.py migrate_schemas --database=non_default --schema=nds. Django is unable to find the schema nds. Also,
I created the tenant via ORM as suggested in the docs but it didn't create the tenant schema. Creating schema manually through create schema nds from psql didn't work either.
Hi,
Use Case:
I'm using this package for quite some time. We encountered a use case in which we have to introduce a new database. Adding a new schema won't suffice so we added another DB with multi-tenancy. Therefore, having two databases operating on a semi-isolated approach. Now, I'm facing an issue regarding the migration of a particular schema in the non-default database.
Code Two DB's are as follows:
Initially, I ran this command:
python manage.py migrate_schemas --database=non_default
. It creates necessary tables in thepublic
schemaNow, when I'm trying to do:
python manage.py migrate_schemas --database=non_default --schema=nds
. Django is unable to find the schemands
. Also,I created the tenant via ORM as suggested in the docs but it didn't create the tenant schema. Creating schema manually through
create schema nds
from psql didn't work either.ORM code
Didn't run any migration
Company.objects.using("non_default")
shows the tenant model but no relations.Any help would be highly appreciated.
Thanks!