From d693a086def21d843c03ec3f5b5e697ed2463d45 Mon Sep 17 00:00:00 2001 From: Frantisek Holop Date: Fri, 22 May 2020 11:40:34 +0200 Subject: Fixed #31615 -- Made migrations skip extension operations if not needed. - Don't try to create an existing extension. - Don't try to drop a nonexistent extension. --- docs/ref/contrib/postgres/operations.txt | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'docs/ref') diff --git a/docs/ref/contrib/postgres/operations.txt b/docs/ref/contrib/postgres/operations.txt index 8696e4e81f..8571cc84e8 100644 --- a/docs/ref/contrib/postgres/operations.txt +++ b/docs/ref/contrib/postgres/operations.txt @@ -30,12 +30,19 @@ For example:: ... ] +Django checks that the extension already exists in the database and skips the +migration if so. + For most extensions, this requires a database user with superuser privileges. If the Django database user doesn't have the appropriate privileges, you'll have to create the extension outside of Django migrations with a user that has them. In that case, connect to your Django database and run the query ``CREATE EXTENSION IF NOT EXISTS hstore;``. +.. versionchanged:: 3.2 + + In older versions, the existence of an extension isn't checked. + .. currentmodule:: django.contrib.postgres.operations ``CreateExtension`` -- cgit v1.3