Giter Club home page Giter Club logo

Comments (6)

bernardopires avatar bernardopires commented on June 16, 2024

You can not have a foreign key between a public and a tenant schema

2013/7/26 Toni Salaet Larrull [email protected]

Hi!

My settings :
SHARED_APPS=(
'tenant_schemas',
'South',
.
.
.
#now I add new app
'Tariff',
)
TENANT_APPS=(
'Core',# Core has a class with a attribute with foreingkey with newapp
'South',
)

When I perform :
$ python manage.py sync_schemas

the tenant schema that has name demo

=== Running syncdb for schema demo

Syncing...

Creating tables ...

Creating table Core_metering_element_data

Creating table Core_metering_element_tariff

DatabaseError: relation "Tariff_company_tariff" does not exist

Anybody knows why I can update my schemas?


Reply to this email directly or view it on GitHubhttps://github.com//issues/54
.

Bernardo Pires Carneiro

from django-tenant-schemas.

tsalaet avatar tsalaet commented on June 16, 2024

Bernardo!

And how I can share the same data with tenants?

from django-tenant-schemas.

bernardopires avatar bernardopires commented on June 16, 2024

You put it on public. You just can't join tables between public and tenant

2013/7/26 Toni Salaet Larrull [email protected]

Bernardo!

And how I can share the same data with tenants?


Reply to this email directly or view it on GitHubhttps://github.com//issues/54#issuecomment-21630740
.

Bernardo Pires Carneiro

from django-tenant-schemas.

tsalaet avatar tsalaet commented on June 16, 2024

Thanks Bernardo

Example Scenario:

Public apps:

Manufacturer ={item,price}

Tenant apps:

Item={Manufacturer[price],stock]

I need to add relation with Manufacturer that's common with all tenants to get some attributes and do a relation with
tenant Items.

Which is the best way to do this?

from django-tenant-schemas.

bernardopires avatar bernardopires commented on June 16, 2024

Sorry, that is not possible with a join. This is a limitation of this app,
but postgresql actually allows what you want to do (foreign key between
different schemas). The problem is that when syncing the tenant apps, the
public schema is not visible. At the same time, it is exactly the fact that
the public schema is not visible when syncing the tenants that allows
django-tenant-schema to work.

2013/7/26 Toni Salaet Larrull [email protected]

Thanks Bernardo

Example Scenario:

Public apps:

Manufacturer ={item,price}

Tenant apps:

Item={Manufacturer[price],stock]

I need to add relation with Manufacturer that's common with all tenants to
get some attributes and do a relation with tenant Items.


Reply to this email directly or view it on GitHubhttps://github.com//issues/54#issuecomment-21632086
.

Bernardo Pires Carneiro

from django-tenant-schemas.

tsalaet avatar tsalaet commented on June 16, 2024

OK bernardo!

thanks!

from django-tenant-schemas.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.