#24307: Oracle Syncdb breaks trying to set NULL to column that already is NULL
----------------------------------------------+-----------------------
     Reporter:  JorisBenschop                 |      Owner:  nobody
         Type:  Bug                           |     Status:  new
    Component:  Database layer (models, ORM)  |    Version:  1.8alpha1
     Severity:  Normal                        |   Keywords:
 Triage Stage:  Unreviewed                    |  Has patch:  0
Easy pickings:  0                             |      UI/UX:  0
----------------------------------------------+-----------------------
 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?

--
Ticket URL: <https://code.djangoproject.com/ticket/24307>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/056.fc8f4b6dac6cdbdaf3c99f84cc1fe06b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to