Closed jonperron closed 7 years ago
The question of TenantModel having a FK relationship to model in the schema doesn't arise as there's no need for such a design. Perhaps you can explain what real-life problem motivated you to ask this?
Hello,
Thank you for your answer !
A specific example of this behaviour is displayed by Microsoft and Office 365, where you log on a common page and are redirected towards your organization Office 365.
Brainstorming about this issue lead us to observe that our issue is beyond the scopes of your app; it is more related to the authentication and how the Django ORM is maintaining FK relationship. In simple words, the FK is not the id
of a model in our case, but the schema.id
of the model.
Hello,
I have a question which is related to #420, but in the other way !
Indeed, I was wondering how django-tenant-schemas handle FK relationship from the tenant model in the public schema towards models in the tenants schemas. For example, is it possible to set the Tenant schema as:
And in a tenant
bar
app:When I do so and following
make_migrations
,python manage.py migrate_schemas --shared
is raising apsycopg2.ProgrammingError: relation "bar_bar" does not exist
, which I think is pretty logical as thebar
model will only exist in the tenant schemas.