上次解决了django2.2和oracle11g兼容性问题,runserver正常启动服务。问题又来了,在运行inspectdb命令时报错了。
错误信息
PS D:\> python manage.py inspectdb
# This is an auto-generated Django model module.
# You'll have to do the following manually to clean this up:
# * Rearrange models' order
# * Make sure each model has one field with primary_key=True
# * Make sure each ForeignKey has `on_delete` set to the desired behavior.
# * Remove `managed = False` lines if you wish to allow Django to create, modify, and delete the table
# Feel free to rename the models, but don't rename db_table values or field names.
from django.db import models
# Unable to inspect table 'auth_group'
# The error was: ORA-00904: "IDENTITY_COLUMN": invalid identifier
# Unable to inspect table 'auth_group_permissions'
# The error was: ORA-00904: "IDENTITY_COLUMN": invalid identifier
# Unable to inspect table 'auth_permission'
# The err

在使用Django 2.2与Oracle 11g时,运行inspectdb命令出现ORA-00904错误。错误根源在于Oracle语法问题,IDENTITY_COLUMN为12c语法。解决方案是临时降级到Django 1.11.22,运行inspectdb后,再升级回原版本,以成功生成models.py。
最低0.47元/天 解锁文章
983

被折叠的 条评论
为什么被折叠?



