This is my dev environment:
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?
From the release notes of django 2.0 (with my emphasis):
The end of upstream support for Oracle 11.2 is Dec. 2020. Django 1.11 will be supported until April 2020 which almost reaches this date. Django 2.0 officially supports Oracle 12.1+.
So, for support of any other version of Oracle, you should downgrade to 1.11
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With