django4.1 oracle19c默认字段nvarchar改成varchar2

python3.9
oracle 19c
cx_oracle
django 4.1.5
mac

我是mac虚拟环境

  1. venv/lib/python3.8/site-packages/django/db/backends/oracle/base.py
  2. 进入目录后修改NVARCHAR,改成VARCHAR修改后数据库中的字段是VARCHAR2
# 我是mac虚拟环境
# venv/lib/python3.8/site-packages/django/db/backends/oracle/base.py

# 进入目录后修改NVARCHAR,改成VARCHAR修改后数据库中的字段是VARCHAR2
data_types = {
        "AutoField": "NUMBER(11) GENERATED BY DEFAULT ON NULL AS IDENTITY",
        "BigAutoField": "NUMBER(19) GENERATED BY DEFAULT ON NULL AS IDENTITY",
        "BinaryField": "BLOB",
        "BooleanField": "NUMBER(1)",
        "CharField": "VARCHAR(%(max_length)s)",
        "DateField": "DATE",
        "DateTimeField": "TIMESTAMP",
        "DecimalField": "NUMBER(%(max_digits)s, %(decimal_places)s)",
        "DurationField": "INTERVAL DAY(9) TO SECOND(6)",
        "FileField": "VARCHAR(%(max_length)s)",
        "FilePathField": "VARCHAR(%(max_length)s)",
        "FloatField": "DOUBLE PRECISION",
        "IntegerField": "NUMBER(11)",
        "JSONField": "NCLOB",
        "BigIntegerField": "NUMBER(19)",
        "IPAddressField": "VARCHAR(15)",
        "GenericIPAddressField": "VARCHAR(39)",
        "OneToOneField": "NUMBER(11)",
        "PositiveBigIntegerField": "NUMBER(19)",
        "PositiveIntegerField": "NUMBER(11)",
        "PositiveSmallIntegerField": "NUMBER(11)",
        "SlugField": "VARCHAR(%(max_length)s)",
        "SmallAutoField": "NUMBER(5) GENERATED BY DEFAULT ON NULL AS IDENTITY",
        "SmallIntegerField": "NUMBER(11)",
        "TextField": "NCLOB",
        "TimeField": "TIMESTAMP",
        "URLField": "VARCHAR(%(max_length)s)",
        "UUIDField": "VARCHAR(32)",
    }



Gitee

https://gitee.com/hayratjan/

Github

https://github.com/hayratjan/

赞赏

赞赏

你可能感兴趣的:(python,django,后端)