diff options
author | Paveł Tyślacki <tbicr@users.noreply.github.com> | 2019-01-01 17:39:58 +0300 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2019-01-01 09:39:58 -0500 |
commit | 0123b67f6b8304a5c32a0fe98f97ae506977454b (patch) | |
tree | 42343d14292507192c1a2266544fe84562ccb74b /django/db/backends/postgresql/schema.py | |
parent | e5ae9488acd45a9758ed5c70240a7e3fad417c00 (diff) | |
download | django-0123b67f6b8304a5c32a0fe98f97ae506977454b.tar.gz |
Fixed #30060 -- Moved SQL generation for indexes and constraints to SchemaEditor.
Diffstat (limited to 'django/db/backends/postgresql/schema.py')
-rw-r--r-- | django/db/backends/postgresql/schema.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/django/db/backends/postgresql/schema.py b/django/db/backends/postgresql/schema.py index dc9959ab4f..9eecaac19a 100644 --- a/django/db/backends/postgresql/schema.py +++ b/django/db/backends/postgresql/schema.py @@ -114,7 +114,7 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor): (old_type.startswith('citext') and not new_type.startswith('citext')) ): 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)) + self.execute(self._delete_index_sql(model, index_name)) super()._alter_field( model, old_field, new_field, old_type, new_type, old_db_params, @@ -130,7 +130,7 @@ 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._meta.db_table, [old_field.column], suffix='_like') - self.execute(self._delete_constraint_sql(self.sql_delete_index, model, index_to_remove)) + self.execute(self._delete_index_sql(model, index_to_remove)) def _index_columns(self, table, columns, col_suffixes, opclasses): if opclasses: |