Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use create_index_name for FK names

  • Loading branch information...
commit b6784bee66d2c310318b6553fbb13f5707475efb 1 parent 15c1920
Andrew Godwin andrewgodwin authored
Showing with 1 addition and 5 deletions.
  1. +1 −5 django/db/backends/schema.py
6 django/db/backends/schema.py
View
@@ -199,11 +199,7 @@ def create_model(self, model):
to_column = field.rel.to._meta.get_field(field.rel.field_name).column
self.deferred_sql.append(
self.sql_create_fk % {
- "name": '%s_refs_%s_%x' % (
- field.column,
- to_column,
- abs(hash((model._meta.db_table, to_table)))
- ),
+ "name": self._create_index_name(model, [field.column], suffix="_fk_%s_%s" % (to_table, to_column)),
"table": self.quote_name(model._meta.db_table),
"column": self.quote_name(field.column),
"to_table": self.quote_name(to_table),
Please sign in to comment.
Something went wrong with that request. Please try again.