Changes between Initial Version and Version 1 of Ticket #29808
- Timestamp:
- Oct 1, 2018, 4:32:56 PM (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #29808
- Property Triage Stage Unreviewed → Accepted
- Property Summary column checks inside "executor.py" is not case sensitive → Applied migration detection may fail when using a case-insensitive collation
- Property Type Uncategorized → Bug
-
Ticket #29808 – Description
initial v1 2 2 I'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) 3 3 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 database4 Now, 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 5 5 {{{ 6 7 8 9 10 11 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 12 12 }}} 13 14 15 13 16 14 so if my migration file contains something like this … … 22 20 }}} 23 21 24 and I run **''python3 manage.py migrate --database my_DB --fake-initial my_first_app''**22 and I run `python3 manage.py migrate --database my_DB --fake-initial my_first_app` 25 23 26 24 it 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")` 28 26 29 If I run **''python3 manage.py migrate --database my_DB --fake my_first_app''** it correctly fakesmy_first_app30 The my_DB collation is case insens tive, while mysql is running with the ''" --lower-case-table-names=0"'' option27 If I run `python3 manage.py migrate --database my_DB --fake my_first_app` it correctly fakes my_first_app 28 The my_DB collation is case insensitive, while MySql is running with the `' --lower-case-table-names=0`' option