0

我有一个项目需要将 django 与 Nexus DB 一起使用。

我已将 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)')

谁可以帮我这个事 ?

谢谢

4

0 回答 0