1
0
mirror of https://github.com/django/django.git synced 2025-10-24 22:26:08 +00:00

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.
This commit is contained in:
Baptiste Mispelon
2014-02-28 13:14:09 +01:00
parent a19f0d0c1e
commit c679cb7f60
2 changed files with 19 additions and 2 deletions

View File

@@ -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