Django-tenants: relation "journal_nav_topnavitem" does not exist even after adding app to SHARED_APPS and running migrate_schemas --shared

I'm working on a multi-tenant Django project using django-tenants with Django 3.2.16. I created an app called journal_nav and initially added it only to TENANT_APPS. Later, I moved it to SHARED_APPS because it provides a common navigation bar for all tenants and the public schema.

I added it to SHARED_APPS in settings.py:

SHARED_APPS = [
    'app123',
    'app456',
    ...
    'journal_nav',  # moved here
]

However, when I visited a route that used a template context processor that queried TopNavItem.objects.all(), I got the following error:

Internal Server Error: /services/typography/
django.db.utils.ProgrammingError: relation "journal_nav_topnavitem" does not exist
LINE 1: ...", "journal_nav_topnavitem"."show_in_topbar" FROM "journal_n...

I then ran:

python manage.py migrate_schemas --shared

But it showed:

[standard:public] Running migrations:
  No migrations to apply.

Even though the model clearly existed and the migration file (0001_initial.py) was present.

Вернуться на верх