I would like django to change the reference to the native django table(s) schema(dbo) as seen in the sql below.
I have renamed the schema to meta in SQL, but when I run the app, it recreates the tables on the dbo schema again in the DB.
So I deleted them again and renamed my meta schemas back to dbo in TSQL and tried to get django to migrate them to the new schema name by running,
python manage.py inspectdb > models.py
The models.py generates and then changing the following in the models.py file in the root folder. eg.
class AuthGroup(models.Model):
# model fields...
class Meta:
db_table = 'meta.auth_group'
Then I run makemigrations and then migrate does not detect the models.py changes.
Is this the correct approach or are we still stuck in changing the user running django to have a default schema to be set to "meta"?
ALTER SCHEMA dbo TRANSFER [meta].[django_admin_log]
ALTER SCHEMA dbo TRANSFER [meta].[admin_interface_theme]
ALTER SCHEMA dbo TRANSFER [meta].[auth_group]
ALTER SCHEMA dbo TRANSFER [meta].[auth_group_permissions]
ALTER SCHEMA dbo TRANSFER [meta].[auth_user]
ALTER SCHEMA dbo TRANSFER [meta].[auth_user_groups]
ALTER SCHEMA dbo TRANSFER [meta].[auth_user_user_permissions]
ALTER SCHEMA dbo TRANSFER [meta].[django_content_type]
ALTER SCHEMA dbo TRANSFER [meta].[django_migrations]
ALTER SCHEMA dbo TRANSFER [meta].[django_session]
ALTER SCHEMA dbo TRANSFER [meta].[reversion_revision]
ALTER SCHEMA dbo TRANSFER [meta].[reversion_version]
ALTER SCHEMA dbo TRANSFER [meta].[auth_permission]