summaryrefslogtreecommitdiff
path: root/django/db/backends/postgresql/schema.py
diff options
context:
space:
mode:
authorSimon Charette <charette.s@gmail.com>2017-04-01 14:00:47 -0400
committerSimon Charette <charette.s@gmail.com>2017-06-20 22:59:22 -0400
commitea91ad4c131816fd0ea8d5f1bfb21b7abd82b47e (patch)
tree2c3ced0c291d19b630c528878a3b740c9b68af23 /django/db/backends/postgresql/schema.py
parentad524980ac9644d5d40c2c79af3c183f4351841e (diff)
downloaddjango-ea91ad4c131816fd0ea8d5f1bfb21b7abd82b47e.tar.gz
Refs #25530 -- Changed _create_index_name to take a table as first parameter.
Diffstat (limited to 'django/db/backends/postgresql/schema.py')
-rw-r--r--django/db/backends/postgresql/schema.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/django/db/backends/postgresql/schema.py b/django/db/backends/postgresql/schema.py
index 1495de29c4..1e505a2134 100644
--- a/django/db/backends/postgresql/schema.py
+++ b/django/db/backends/postgresql/schema.py
@@ -111,7 +111,7 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
(old_type.startswith('varchar') and not new_type.startswith('varchar')) or
(old_type.startswith('text') and not new_type.startswith('text'))
):
- index_name = self._create_index_name(model, [old_field.column], suffix='_like')
+ index_name = self._create_index_name(model._meta.db_table, [old_field.column], suffix='_like')
self.execute(self._delete_constraint_sql(self.sql_delete_index, model, index_name))
super()._alter_field(
@@ -127,5 +127,5 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
# Removed an index? Drop any PostgreSQL-specific indexes.
if old_field.unique and not (new_field.db_index or new_field.unique):
- index_to_remove = self._create_index_name(model, [old_field.column], suffix='_like')
+ index_to_remove = self._create_index_name(model._meta.db_table, [old_field.column], suffix='_like')
self.execute(self._delete_constraint_sql(self.sql_delete_index, model, index_to_remove))