Permalink
Browse files

Use create_index_name for FK names

  • Loading branch information...
1 parent 15c1920 commit b6784bee66d2c310318b6553fbb13f5707475efb @andrewgodwin andrewgodwin committed Sep 24, 2012
Showing with 1 addition and 5 deletions.
  1. +1 −5 django/db/backends/schema.py
@@ -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),

0 comments on commit b6784be

Please sign in to comment.