查询执行失败:\ r \ n表已存在。 (表名:django_migrations)

时间:2019-06-07 07:01:50

标签: django python-3.x pyodbc django-pyodbc nexusdb

我有一个项目,需要在Nexus DB中使用django。

我已将django-pyodbc软件包定制为可压缩为nexusDB的第三方数据库引擎。但是在进行初始迁移时发现了此错误。

Traceback (most recent call last):
File "D:\Projects\xxx\venv\lib\site- 
packages\django\db\migrations\recorder.py", line 55, in ensure_schema
editor.create_model(self.Migration)
File "D:\Projects\xxx\venv\lib\site- 
packages\django\db\backends\base\schema.py", line 312, in create_model
self.execute(sql, params or None)
File "D:\Projects\xxx\venv\lib\site- 
packages\django\db\backends\base\schema.py", line 133, in execute
cursor.execute(sql, params)
File "D:\Projects\xxx\venv\lib\site- 
packages\django\db\backends\utils.py", line 100, in execute
return super().execute(sql, params)
File "D:\Projects\xxx\venv\lib\site- 
packages\django\db\backends\utils.py", line 68, in execute
return self._execute_with_wrappers(sql, params, many=False, 
executor=self._execute)
File "D:\Projects\xxx\venv\lib\site- 
packages\django\db\backends\utils.py", line 77, in _execute_with_wrappers
return executor(sql, params, many, context)
File "D:\Projects\xxx\venv\lib\site- 
packages\django\db\backends\utils.py", line 83, in _execute
return self.cursor.execute(sql)
File "D:\Projects\xxx\django_pyodbc\base.py", line 485, in execute
raise utils.DatabaseError(*e.args)
django.db.utils.DatabaseError: ('HY000', '[HY000] The query returned an 
error (ODBC State: HY000)\r\rError:\rNexusDB: <unnamed TnxODBCQuery 
instance>: Query execution failed: \r\nTable already exists. (Tablename: 
django_migrations)\r\n\r\n [$3304/13060]\r\rQuery:\rCREATE TABLE  
django_migrations  ( id  AUTOINC NOT NULL PRIMARY KEY,  app  NULLSTRING  
NOT NULL,  name  NULLSTRING  NOT NULL,  applied  DATETIME NOT NULL)\r\r 
(-1) (SQLExecDirectW)')

有人可以帮我吗?

谢谢

0 个答案:

没有答案