#8349: syncdb doesn't make all the necessary changes with the Oracle backend
--------------------------------------+-------------------------------------
          Reporter:  guneeyoufix      |         Owner:  nobody
            Status:  new              |     Milestone:        
         Component:  django-admin.py  |       Version:  SVN   
        Resolution:                   |      Keywords:        
             Stage:  Unreviewed       |     Has_patch:  0     
        Needs_docs:  0                |   Needs_tests:  0     
Needs_better_patch:  0                |  
--------------------------------------+-------------------------------------
Comment (by guneeyoufix):

 Let's try to explain the problem here.

 With oracle, you don't directly have the concept of auto incrementing
 field, like you have in MySQL.
 To get this functionality with Oracle, you have to create a sequence, and
 a trigger that returns the next index in the sequence when inserting a new
 row. And that's how django handles the autofield.

 However, you can also use the .NEXTVAL attribute of a sequence to get this
 number (which is actually what you do in the trigger) in the place of the
 autofield.
 Here is an example : INSERT INTO TABLE(PK, OTHER_STUFF) VALUES
 (PK_SEQUENCE.NEXTVAL, 'STUFF');
 This is actually how I handle my primary keys outside the django
 framework.

 Not being able to use this technique from the django framework, I modified
 the output of the inspectdb command so that these columns are filled
 automatically.

 After the modifications, I ran syncdb so that all the necessary oracle
 objects are created. But the triggers and sequences that should be created
 (because they don't already exist in the database) are not created. And I
 believe the role of syncdb is precisely to create all necessary objects
 that are don't already exist.

 Hence this ticket.
 Hope it's clear now what my problem is...

-- 
Ticket URL: <http://code.djangoproject.com/ticket/8349#comment:2>
Django Code <http://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 post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to