#2495: db.models.TextField cannot be marked unique when using mysql backend
---------------------------------------------------+------------------------
          Reporter:  anonymous                     |         Owner:  Honza_Kral 
    
            Status:  new                           |     Milestone:             
    
         Component:  Database layer (models, ORM)  |       Version:  SVN        
    
        Resolution:                                |      Keywords:  mysql 
TextField
             Stage:  Accepted                      |     Has_patch:  1          
    
        Needs_docs:  0                             |   Needs_tests:  0          
    
Needs_better_patch:  0                             |  
---------------------------------------------------+------------------------
Comment (by Honza_Kral):

 Replying to [comment:17 danny...@toldme.com]:
 > Hello,
 >
 > How do I replace the constraint with ALTER TABLE?
 > mysql> alter table events_tag add primary key(name);
 > ERROR 1170 (42000): BLOB/TEXT column 'name' used in key specification
 without a key length

 well, specify a key length:
 mysql> alter table events_tag add primary key(name(255));
 should work

-- 
Ticket URL: <http://code.djangoproject.com/ticket/2495#comment:19>
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 django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.


Reply via email to