Changes between Initial Version and Version 1 of Ticket #29808


Ignore:
Timestamp:
10/01/18 21:32:56 (4 years ago)
Author:
Tim Graham
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #29808

    • Property Triage Stage changed from Unreviewed to Accepted
    • Property Type changed from Uncategorized to Bug
    • Property Summary changed from column checks inside "executor.py" is not case sensitive to Applied migration detection may fail when using a case-insensitive collation
  • Ticket #29808 – Description

    initial v1  
    22I'm using this guide  https://datascience.blog.wzb.eu/2017/03/21/using-django-with-an-existinglegacy-database for my studies with camelCasing together with Django (yes, I'm still trying to keep the naming convention we have inside our DB, also for the model's names)
    33
    4 Now, I'm really new to Django and I don't know if it's intended but this part of code inside** "executor.py"**'''' is doing case sensitive comparison to check if a column is already present in a database
     4Now, I'm really new to Django and I don't know if it's intended but this part of code inside `django/db/migrations/executor.py`' is doing case sensitive comparison to check if a column is already present in a database
    55{{{
    6                 column_names = [
    7                     column.name for column in
    8                     self.connection.introspection.get_table_description(self.connection.cursor(), table)
    9                 ]
    10                 if field.column not in column_names:
    11                     return False, project_state
     6column_names = [
     7    column.name for column in
     8    self.connection.introspection.get_table_description(self.connection.cursor(), table)
     9]
     10if field.column not in column_names:
     11    return False, project_state
    1212}}}
    13 
    14 
    1513
    1614so if my migration file contains something like this
     
    2220}}}
    2321
    24 and I run     **''python3 manage.py migrate --database my_DB --fake-initial my_first_app''**
     22and I run `python3 manage.py migrate --database my_DB --fake-initial my_first_app`
    2523
    2624it fires  an error saying that that table already exists
    27 **''django.db.utils.OperationalError: (1050, "Table 'city' already exists")''**
     25`django.db.utils.OperationalError: (1050, "Table 'city' already exists")`
    2826
    29 If I run  **''python3 manage.py migrate --database my_DB --fake my_first_app''**  it correctly fakes   my_first_app
    30 The  my_DB  collation is case insenstive, while  mysql is running with the  ''" --lower-case-table-names=0"''   option
     27If I run `python3 manage.py migrate --database my_DB --fake my_first_app`  it correctly fakes  my_first_app
     28The  my_DB  collation is case insensitive, while MySql is running with the  `' --lower-case-table-names=0`'   option
Back to Top