This is my dev environment:
- Windows 7 (x64)
- Python 3.6.3 64bit (virtual environment)
- Django 2.0
- cx_Oracle 6.1
- Oracle 11.2 Enterprise Edition 64 bit (on remote machine)
I am failing to migrate
(django manage.py migrate) because Django is creating sql suitable for Oracle 12c; but I am using 11g.
For example, django tries to execute this:
SELECT
CASE WHEN identity_column = 'YES' THEN 1 ELSE 0 END
FROM user_tab_cols
WHERE table_name = 'DJANGO_CONTENT_TYPE' AND
column_name = 'NAME';
('DJANGO_CONTENT_TYPE', 'NAME');
args=['DJANGO_CONTENT_TYPE', 'NAME']
But the column identity_column
is not available on oracle 11g.
How can I make django use 11g syntax?
EDIT:
Tracing back the exception I found this in ..\Lib\site-packages\django\db\backends\oracle\schema.py
(method _is_identity_column
, line 151):
cursor.execute("""
SELECT
CASE WHEN identity_column = 'YES' THEN 1 ELSE 0 END
FROM user_tab_cols
WHERE table_name = %s AND
column_name = %s
""", [self.normalize_name(table_name), self.normalize_name(column_name)])
So the syntax is hard coded. Does this mean Django 2.0 is for Oracle 12c an onwards?