summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorFrantisek Holop <fholop@ripe.net>2020-05-22 11:40:34 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2020-05-27 10:48:44 +0200
commitd693a086def21d843c03ec3f5b5e697ed2463d45 (patch)
tree80e4d994b454d529596f7022607d33c1ad6472c0 /docs
parentf3ed42c8ad3757e7238bf2f326532f5b129aa102 (diff)
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.
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/contrib/postgres/operations.txt7
-rw-r--r--docs/releases/3.2.txt4
2 files changed, 10 insertions, 1 deletions
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``
diff --git a/docs/releases/3.2.txt b/docs/releases/3.2.txt
index 84f757cd2b..bd8db085a9 100644
--- a/docs/releases/3.2.txt
+++ b/docs/releases/3.2.txt
@@ -63,7 +63,9 @@ Minor features
:mod:`django.contrib.messages`
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-* ...
+* The :class:`~django.contrib.postgres.operations.CreateExtension` operation
+ now checks that the extension already exists in the database and skips the
+ migration if so.
:mod:`django.contrib.postgres`
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~