Opened 9 years ago

Closed 8 years ago

Last modified 7 years ago

#2959 closed defect (invalid)

Capital letters in app name break syncdb

Reported by: Yary Owned by: adrian
Component: Core (Other) Version: 0.95
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

create an app as in tutorial 1, but capitalize Polls:

python manage.py startapp Polls

>cd Polls; cat > models.py
from django.db import models

class Poll(models.Model):
    question = models.CharField(maxlength=200)
    pub_date = models.DateTimeField('date published')

^D

>cd ..

(add 'mysite.Polls' to settings.py INSTALLED_APPS)

>manage.py syncdb
Creating table Polls_poll
Adding permission 'poll | Can add poll'
Adding permission 'poll | Can change poll'
Adding permission 'poll | Can delete poll'

>manage.py syncdb
Creating table Polls_poll
Traceback ...
    raise errorclass, errorvalue
_mysql_exceptions.OperationalError: (1050, "Table 'polls_poll' already exists")

Change History (2)

comment:1 Changed 8 years ago by Simon G. <dev@…>

  • Resolution set to invalid
  • Status changed from new to closed

I'm marking this as invalid, as the error is because you already have a polls_poll table. I can't replicate the upper/lowercase issue (the tablename appears to be cast to lowercase)

comment:2 Changed 7 years ago by Collin Grady <cgrady@…>

For anyone coming across this, the issue appears to be with lower_case_table_names in MySQL defaulting to 1 in Windows, which breaks this.

Note: See TracTickets for help on using tickets.
Back to Top