Comments (10)
you have to run ./manage.py migrate_schemas
not ./manage.py migrate
2013/6/23 maxwelld90 [email protected]
Hello,
Thank you for writing this app - it is fantastic - exactly what I am in
need of.I am having a bit of difficulty getting integration with South working. I
have followed your simple tutorial at
https://django-tenant-schemas.readthedocs.org/en/latest/use.html - after
setting everything up as stated in
https://django-tenant-schemas.readthedocs.org/en/latest/install.html.However, I am still confused with how I can use South and this app. I see
the commands in the tutorial but cannot figure out the order in which I run
them.For example, I wish to add an additional field, 'additional_field', to the
Client model. I add in the field, then I run ./manage.py migrate. But I
receive a DatabaseError:DatabaseError: column customers_client.additional_field does not exist
LINE 1: ...ent"."paid_until", "customers_client"."on_trial", "customers...Am I missing something? Can someone provide a simple example as to how
this can be rectified?Many thanks.
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/49
.
Bernardo Pires Carneiro
from django-tenant-schemas.
Thanks for getting back to me.
When I run ./manage.py migrate_schemas, I get the same DatabaseError : - (
=== Running migrate for schema public
DatabaseError: column customers_client.additional_field does not exist
LINE 1: ...ent"."paid_until", "customers_client"."on_trial", "customers...
from django-tenant-schemas.
the error you are getting is unusual. it should not try to find
additional_field, considering this is the field you are trying to add. are
you sure you have the correct migrations?
2013/6/23 maxwelld90 [email protected]
Thanks for getting back to me.
When I run ./manage.py migrate_schemas, I get the same DatabaseError : - (
=== Running migrate for schema public
DatabaseError: column customers_client.additional_field does not exist
LINE 1: ...ent"."paid_until", "customers_client"."on_trial", "customers...—
Reply to this email directly or view it on GitHubhttps://github.com//issues/49#issuecomment-19875026
.
Bernardo Pires Carneiro
from django-tenant-schemas.
I got the same error. Very strange because I didn't get this error before.
from django-tenant-schemas.
It seems a bit odd, but I managed to workaround this situation by changing get_tenant_model().objects
calls to get_tenant_model().objects.only('schema_name')
so it does not looks for additional fields that exists in the code but not in the database.
I mean it does look odd because I didn't have this problem before. Nonetheless it's very understandable.
from django-tenant-schemas.
@bcarneiro could you try to reproduce this behavior?
Just add a field to the model referred by get_tenant_model()
then create a migration and try to run it.
from django-tenant-schemas.
Sorry Caio, couldn't reproduce this issue. I have a model called LawFirm and I added a new field.
./manage.py schemamigration firms --auto
- Added field balance_available2 on firms.LawFirm
Created 0002_auto__add_field_lawfirm_balance_available2.py. You can now apply this migration with: ./manage.py migrate firms
./manage.py migrate_schemas
=== Running migrate for schema public
Running migrations for firms:
- Migrating forwards to 0002_auto__add_field_lawfirm_balance_available2.
firms:0002_auto__add_field_lawfirm_balance_available2
- Loading initial data for firms.
Installed 0 object(s) from 0 fixture(s)
Can you try to get a sequence of steps to reproduce your error? Thanks!
from django-tenant-schemas.
Is LawFirm
defined as your TENANT_MODEL
?
from django-tenant-schemas.
Yes, TENANT_MODEL = "firms.LawFirm"
2013/8/12 Caio Ariede [email protected]
Is LawFirm defined as your TENANT_MODEL?
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/49#issuecomment-22516343
.
Bernardo Pires Carneiro
from django-tenant-schemas.
I'm closing this as it seems noone can reproduce this issue. Feel free to open it if you guys have any new information about it!
from django-tenant-schemas.
Related Issues (20)
- 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
- About changing public schema to other schema. HOT 2
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.