Ticket #412 (closed defect: fixed)
Oracle backend generates wrong sql for some fields
| Reported by: | Siddharta <siddharta@…> | Owned by: | andrew |
|---|---|---|---|
| Priority: | major | Milestone: | 1.0 |
| Component: | migrations | Version: | 0.7 |
| Keywords: | oracle | Cc: |
Description
The Oracle backend correctly generates sql for null columns with a default value by swapping the order.
NULL DEFAULT ' ' => DEFAULT ' ' NULL
In the above case the left is the default column SQL and the right is the correct SQL to run on Oracle. The backend deals with the above case, but leaves out the following cases
NULL PRIMARY KEY DEFAULT ' ' => DEFAULT ' ' PRIMARY KEY NULL
NOT NULL DEFAULT ' ' => DEFAULT ' ' NOT NULL
NOT NULL PRIMARY KEY DEFAULT ' ' => DEFAULT ' ' PRIMARY KEY NOT NULL
So if you have a field that is NOT NULL and PRIMARY KEY and has a default (or any one of those 3 cases), then the sql generated will cause this error:
ORA-00907: missing right parenthesis
