1
0
mirror of https://github.com/django/django.git synced 2025-06-05 03:29:12 +00:00

[1.10.x] Refs #27162 -- Complemented docs related to CreateExtension

Thanks Tim Graham for the review.

Backport of 6b54504e667da3f6bc53b887ffd7e8cc113a94b1 from master
This commit is contained in:
Claude Paroz 2016-09-01 15:59:33 +02:00 committed by Tim Graham
parent 2078b187f7
commit 0a81f540c9
2 changed files with 18 additions and 1 deletions

View File

@ -65,7 +65,17 @@ functionality::
The database user must be a superuser in order to run The database user must be a superuser in order to run
``CREATE EXTENSION postgis;``. The command is run during the :djadmin:`migrate` ``CREATE EXTENSION postgis;``. The command is run during the :djadmin:`migrate`
process. process. An alternative is to use a migration operation in your project::
from django.contrib.postgresql.operations import CreateExtension
from django.db import migrations
class Migration(migrations.Migration):
operations = [
CreateExtension('postgis'),
...
]
GeoDjango does not currently leverage any `PostGIS topology functionality`__. GeoDjango does not currently leverage any `PostGIS topology functionality`__.
If you plan to use those features at some point, you can also install the If you plan to use those features at some point, you can also install the

View File

@ -164,6 +164,13 @@ lookups that use the ``LIKE`` operator in their SQL, as is done with the
.. _PostgreSQL operator class: http://www.postgresql.org/docs/current/static/indexes-opclass.html .. _PostgreSQL operator class: http://www.postgresql.org/docs/current/static/indexes-opclass.html
Migration operation for adding extensions
-----------------------------------------
If you need to add a PostgreSQL extension (like ``hstore``, ``postgis``, etc.)
using a migration, use the
:class:`~django.contrib.postgres.operations.CreateExtension` operation.
Speeding up test execution with non-durable settings Speeding up test execution with non-durable settings
---------------------------------------------------- ----------------------------------------------------