django-pyodbc-azure-如何使用模式 [英] django-pyodbc-azure - How to use schemas
本文介绍了django-pyodbc-azure-如何使用模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用django-pyodbc-azure( https://github.com/michiya/django-pyodbc-azure ),一切正常.但是,当我迁移模型时,将在SQL Server数据库上创建一个名为"dbo"的新架构.我想使用一个已经存在的'sp'模式,有什么方法可以设置工作模式吗?
I'm using django-pyodbc-azure (https://github.com/michiya/django-pyodbc-azure) and everything is working fine. However, when I migrate the models, a new schema called 'dbo' is created on the SQL Server database. I want to use an already existing 'sp' schema, is there any way to set the working schema?
谢谢.
推荐答案
IIRC,您需要为连接的用户更改默认架构.如果您使用的是名为 django_user
的SQL Auth用户:
IIRC, you need to change the default schema for the user your are connecting as. If you're using a SQL Auth user called django_user
:
ALTER USER django_user WITH DEFAULT_SCHEMA = [sp]
祝你好运.
这篇关于django-pyodbc-azure-如何使用模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文