summaryrefslogtreecommitdiff
path: root/django/db
diff options
context:
space:
mode:
authorBaptiste Mispelon <bmispelon@gmail.com>2014-02-28 13:14:09 +0100
committerBaptiste Mispelon <bmispelon@gmail.com>2014-03-01 13:45:45 +0100
commitc679cb7f600b13646a1a2b5fc8a03dfcc2e413f2 (patch)
tree976f24bdfbca904fdaafcf0fdbec609e19dc76e5 /django/db
parenta19f0d0c1e128634b9e393c52148167bf8718b4c (diff)
Fixed #22168 -- Fixed migrations failing on sqlite when column names are SQL keywords
Thanks to trac user fallen_flint for the report and initial patch.
Diffstat (limited to 'django/db')
-rw-r--r--django/db/backends/sqlite3/schema.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/django/db/backends/sqlite3/schema.py b/django/db/backends/sqlite3/schema.py
index 279ac4b203..e8fc2635d1 100644
--- a/django/db/backends/sqlite3/schema.py
+++ b/django/db/backends/sqlite3/schema.py
@@ -83,8 +83,8 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
field_maps = list(mapping.items())
self.execute("INSERT INTO %s (%s) SELECT %s FROM %s" % (
self.quote_name(temp_model._meta.db_table),
- ', '.join(x for x, y in field_maps),
- ', '.join(y for x, y in field_maps),
+ ', '.join(self.quote_name(x) for x, y in field_maps),
+ ', '.join(self.quote_name(y) for x, y in field_maps),
self.quote_name(model._meta.db_table),
))
# Delete the old table