Changes between Initial Version and Version 2 of Ticket #9116


Ignore:
Timestamp:
Nov 10, 2008, 8:48:59 AM (15 years ago)
Author:
Ramiro Morales
Comment:

(reformatted description)

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #9116

    • Property Triage Stage UnreviewedDesign decision needed
  • Ticket #9116 – Description

    initial v2  
    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:
     1I have an application with name `localModels` and `lower_case_table_names` mysql variable=1, which said to MySQL automatically convert table name to lowercase.
     2Let's look in `djnago.core.management.commnads.syncdb.py`, line 67:
    33{{{
    44#!python
     
    66    continue
    77}}}
    8 connection.introspection.table_name_converter(model._meta.db_table) = 'localModels_tablename'
     8`connection.introspection.table_name_converter(model._meta.db_table) = 'localModels_tablename'`
    99in 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', ...)`
     11so here your condition doesn't work, beacuse `'localModels_tablename'!='localmodels_tablename'`.
     12And we have an exception in `manage.py syncdb`:
     13{{{
    1314_mysql_exceptions.OperationalError: (1050, "Table 'localmodels_tablename' already exists")
     15}}}
    1416
    1517So 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.
Back to Top