bernardopires / django-tenant-schemas

Tenant support for Django using PostgreSQL schemas.
https://django-tenant-schemas.readthedocs.org/en/latest/
MIT License
1.46k stars 423 forks source link

What's the equivalent of sync_schemas in the new version? #382

Closed danprado closed 7 years ago

danprado commented 8 years ago

I would like to call a "sync_schemas" command to apply some changes I have made to my "Shared vs Tenant apps". How can I do that in the new version?

bernardopires commented 8 years ago

Should be in the docs, didn't migrate_schemas work for you?

danprado commented 8 years ago

Oh, are they the same? I thought they had different behaviour. I have moved a couple apps from Shared to Tenant and migrate_schemas shows "no migrations to apply". Makemigrations shows "no changes detected" also. I've found some old issues mentioning the "sync_schemas" command. That's why I thought it would have a different behaviour. Do you have any suggestions on what I can try to force it to apply my changes to tenant apps?

bernardopires commented 8 years ago

Please just follow the manual and make sure you upgrade Django (if you are on a version older than 1.8). The docs don't even mention sync_schemas anymore, that was before Django 1.8. You should check the django docs regarding migrations. You are proably missing the initial migrations.

danprado commented 8 years ago

I'm using the latest version of Django. I have the initial migrations and everything was working fine. My issue is: after moving some apps from shared to tenant, "makemigrations" or "migrate_schames" doesn't apply any migrations. Any tips?