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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user