Fixed #22498 -- constraint name was not quoted in FK creation SQL
This commit is contained in:
parent
53d97e4fe3
commit
843613add4
|
@ -419,11 +419,11 @@ class BaseDatabaseSchemaEditor(object):
|
||||||
to_column = field.rel.to._meta.get_field(field.rel.field_name).column
|
to_column = field.rel.to._meta.get_field(field.rel.field_name).column
|
||||||
self.deferred_sql.append(
|
self.deferred_sql.append(
|
||||||
self.sql_create_fk % {
|
self.sql_create_fk % {
|
||||||
"name": '%s_refs_%s_%x' % (
|
"name": self.quote_name('%s_refs_%s_%x' % (
|
||||||
field.column,
|
field.column,
|
||||||
to_column,
|
to_column,
|
||||||
abs(hash((model._meta.db_table, to_table)))
|
abs(hash((model._meta.db_table, to_table)))
|
||||||
),
|
)),
|
||||||
"table": self.quote_name(model._meta.db_table),
|
"table": self.quote_name(model._meta.db_table),
|
||||||
"column": self.quote_name(field.column),
|
"column": self.quote_name(field.column),
|
||||||
"to_table": self.quote_name(to_table),
|
"to_table": self.quote_name(to_table),
|
||||||
|
|
Loading…
Reference in New Issue