Django tenant-specific migrations issue: relation does not exist after applying custom migrations
Posted by Such_Benefit_9415@reddit | sysadmin | View on Reddit | 0 comments
I'm working on a Django multi-tenant setup where each tenant has a separate database. I have custom migration directories for each tenant. After running migrate_tenant
for a tenant, the migration completes successfully, but when trying to query the table in the admin or the Django shell, I get an error: relation "custom_migrations_customer" does not exist
.
- I’m using PostgreSQL for the tenant databases.
- The migration files are stored in custom locations (
localhost_migrations
). - The table does not appear in the PostgreSQL schema.
Steps taken so far:
- Ensured
MIGRATION_MODULES
points to the correct path. - Verified database connection during migrations.
- Manually checked the schema in PostgreSQL.
Any help or guidance would be appreciated. Thank you!