Changes between Initial Version and Version 2 of Ticket #9116
- Timestamp:
- Nov 10, 2008, 8:48:59 AM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #9116
- Property Triage Stage Unreviewed → Design decision needed
-
Ticket #9116 – Description
initial v2 1 I have an application with name localModels and lower_case_table_namesmysql variable=1, which said to MySQL automatically convert table name to lowercase.2 Let's look in djnago.core.management.commnads.syncdb.py, line 67:1 I have an application with name `localModels` and `lower_case_table_names` mysql variable=1, which said to MySQL automatically convert table name to lowercase. 2 Let's look in `djnago.core.management.commnads.syncdb.py`, line 67: 3 3 {{{ 4 4 #!python … … 6 6 continue 7 7 }}} 8 connection.introspection.table_name_converter(model._meta.db_table) = 'localModels_tablename' 8 `connection.introspection.table_name_converter(model._meta.db_table) = 'localModels_tablename'` 9 9 in tables we have 10 (..., 'localmodels_tablename', ...) 11 so here your condition doesn't work, beacuse 'localModels_tablename'!='localmodels_tablename'. 12 And we have an exception in manage.py syncdb: 10 `(..., 'localmodels_tablename', ...)` 11 so here your condition doesn't work, beacuse `'localModels_tablename'!='localmodels_tablename'`. 12 And we have an exception in `manage.py syncdb`: 13 {{{ 13 14 _mysql_exceptions.OperationalError: (1050, "Table 'localmodels_tablename' already exists") 15 }}} 14 16 15 17 So I see at least 2 ways: 16 1. Generate SQL 'CREATE TABLE `tablename` IF NOT EXIST' 17 2. Check MySQL's lower_case_table_names variable and change condition on line 67. 18 19 1. Generate SQL {{{'CREATE TABLE `tablename` IF NOT EXIST'}}} 20 2. Check MySQL's `lower_case_table_names` variable and change condition on line 67.