Comments (6)
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_schemasthe 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.
Bernardo!
And how I can share the same data with tenants?
from django-tenant-schemas.
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.
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.
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.
OK bernardo!
thanks!
from django-tenant-schemas.
Related Issues (20)
- weird behaviour using "with schema_context" HOT 3
- Can't migrate new tables to tennant apps.
- New tenant model is not creating relations in non-public schema with multiple databases
- Accessing tenants data from public. HOT 1
- django-tenants TypeError: argument of type 'TenantQueryset' is not iterable
- ImportError: cannot import name 'force_text' from 'django.utils.encoding' HOT 3
- How to create tenant_schemas.storage.TenantFileSystemStorage within AWS s3 bucket with django-storages 1.12.3
- "Apps aren't loaded yet" when upgrading from django 3.0.10 to 3.2
- Schema Deletion HOT 1
- DRF example
- Support for django 4.0 HOT 7
- how to launch tenant_command loaddata from views with fixtures HOT 1
- Supported Version Django HOT 3
- Distinguish between workspaces
- error 500 DEBUG=False in production HOT 1
- [Solution] Unable to create the django_migrations -relation already exists HOT 1
- healthcheck HOT 2
- Issue in holding DB connection consistently HOT 1
- @contextmanager
- Django-tenants - please help
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-tenant-schemas.