#56: MySQL id columns should be UNSIGNED
---------------------------------------------------+------------------------
          Reporter:  Manuzhai <[email protected]>   |         Owner:       
            Status:  new                           |     Milestone:       
         Component:  Database layer (models, ORM)  |       Version:  SVN  
        Resolution:                                |      Keywords:  mysql
             Stage:  Accepted                      |     Has_patch:  1    
        Needs_docs:  1                             |   Needs_tests:  1    
Needs_better_patch:  1                             |  
---------------------------------------------------+------------------------
Changes (by russellm):

  * needs_better_patch:  0 => 1
  * needs_docs:  0 => 1
  * needs_tests:  0 => 1
  * milestone:  2.0 =>

Comment:

 The concern isn't about the table itself; it's about the foreign keys
 referencing the table. A new table pointing to an old table would have a
 foreign key that would allow invalid values; if you recreate a base table
 that has foreign keys pointing at it, you will be able to create instances
 that you can't refer to.

 However, talking this over with Malcolm some more, we think we've got a
 way to do this. Lets add an 'unsigned=False' option to AutoField. By
 default, it needs to be False for backwards compatibility; when 2.0 comes
 around, we can change this to be unsigned by default.

 The change needs to be made for other backends (e.g., serial under
 Postgres needs to be changed to bigserial if unsigned=True), but this
 provides a way to access unsigned representations in a completely opt-in
 way for people who want them, and provides a simple way to migrate
 forward.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/56#comment:22>
Django <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