#13183: db_table case sensitive
------------------------------------------+---------------------------------
 Reporter:  noppes                        |       Owner:  nobody    
   Status:  new                           |   Milestone:            
Component:  Database layer (models, ORM)  |     Version:  SVN       
 Keywords:                                |       Stage:  Unreviewed
Has_patch:  0                             |  
------------------------------------------+---------------------------------
 I have the model:
 {{{
 class UserProfile(models.Model):
     user = models.ForeignKey(User)

     class Meta:
         db_table = "UserProfile"
 }}}
 and when i run manage.py syncdb for a second time i get this error:
 {{{
 python manage.py syncdb
 Creating table UserProfile
 Traceback (most recent call last):
   File "manage.py", line 11, in <module>
     execute_manager(settings)
   File "D:\Python26\lib\site-packages\django\core\management\__init__.py",
 line
 438, in execute_manager
     utility.execute()
   File "D:\Python26\lib\site-packages\django\core\management\__init__.py",
 line
 379, in execute
     self.fetch_command(subcommand).run_from_argv(self.argv)
   File "D:\Python26\lib\site-packages\django\core\management\base.py",
 line 196,
  in run_from_argv
     self.execute(*args, **options.__dict__)
   File "D:\Python26\lib\site-packages\django\core\management\base.py",
 line 223,
  in execute
     output = self.handle(*args, **options)
   File "D:\Python26\lib\site-packages\django\core\management\base.py",
 line 352,
  in handle
     return self.handle_noargs(**options)
   File "D:\Python26\lib\site-
 packages\django\core\management\commands\syncdb.py"
 , line 94, in handle_noargs
     cursor.execute(statement)
   File "D:\Python26\lib\site-packages\django\db\backends\util.py", line
 19, in e
 xecute
     return self.cursor.execute(sql, params)
   File "D:\Python26\lib\site-packages\django\db\backends\mysql\base.py",
 line 86
 , in execute
     return self.cursor.execute(query, args)
   File "D:\Python26\lib\site-packages\MySQLdb\cursors.py", line 173, in
 execute
     self.errorhandler(self, exc, value)
   File "D:\Python26\lib\site-packages\MySQLdb\connections.py", line 36, in
 defau
 lterrorhandler
     raise errorclass, errorvalue
 _mysql_exceptions.OperationalError: (1050, "Table 'userprofile' already
 exists")
 }}}
 my guess is that this is a case problem.

 first time I ran manage.py syncdb it said: Creating table UserProfile, but
 it actually created userprofile in lower case.

 when i change db_table = "UserProfile" to db_table = "userprofile" i dont
 get the error
 but I ofcourse want my database tables with capital letters

-- 
Ticket URL: <http://code.djangoproject.com/ticket/13183>
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