mirror of
https://github.com/django/django.git
synced 2025-08-04 10:59:45 +00:00
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.
This commit is contained in:
parent
f3ed42c8ad
commit
d693a086de
4 changed files with 54 additions and 6 deletions
|
@ -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``
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue