﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
24307	Oracle Syncdb breaks trying to set NULL to column that already is NULL	JorisBenschop	Shai Berger	"hi

I'm not sure if this is a dev question. Probably I did something dumb, so I hope you can help me discover what that is:

I'm trying to syncdb to an empty Oracle DB. Many tables, triggers and sequences are made but then this:
{{{
...
Synchronizing apps without migrations:
  Creating tables...
    Running deferred SQL...
  Installing custom SQL...
Running migrations:
  Rendering model states... DONE
  Applying contenttypes.0002_remove_content_type_name...DEBUG ALTER TABLE ""DJANGO_CONTENT_TYPE"" MODIFY ""NAME"" NULL; (params [])
DEBUG (0.055) QUERY = u'ALTER TABLE ""DJANGO_CONTENT_TYPE"" MODIFY ""NAME"" NULL' - PARAMS = (); args=[]
Traceback (most recent call last):
...
...
django.db.utils.DatabaseError: ORA-01451: column to be modified to NULL cannot be modified to NULL
}}}

Indeed if I run this in oracle directly:
{{{
ALTER TABLE ""DJANGO_CONTENT_TYPE"" MODIFY ""NAME"" NULL;
}}}
I get the same error: you cannot change a NULL column into NULL

I don't understand why django wants to alter a column name of a table it just made a few seconds before, but still. What seems to happen is that it changes a column to NULL, but because it already is NULL, the statement fails.
Workaround is to manually set:
{{{
ALTER TABLE ""DJANGO_CONTENT_TYPE"" MODIFY (""NAME"" NOT NULL);
}}}
Then run syncdb again and the error is gone.

I can see this is sillyness of oracle, but there's not much I can do about that. Is this a bug?

"	Bug	closed	Database layer (models, ORM)	1.8alpha1	Release blocker	fixed	oracle 1.8-beta		Accepted	1	0	1	1	0	0
