Refs #27030 -- Added BtreeGinExtension operation.
This commit is contained in:
parent
e1acc9dc66
commit
236baa0f0e
|
@ -46,3 +46,9 @@ class TrigramExtension(CreateExtension):
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.name = 'pg_trgm'
|
self.name = 'pg_trgm'
|
||||||
|
|
||||||
|
|
||||||
|
class BtreeGinExtension(CreateExtension):
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
self.name = 'btree_gin'
|
||||||
|
|
|
@ -18,6 +18,15 @@ the ``django.contrib.postgres.operations`` module.
|
||||||
|
|
||||||
This is a required argument. The name of the extension to be installed.
|
This is a required argument. The name of the extension to be installed.
|
||||||
|
|
||||||
|
``BtreeGinExtension``
|
||||||
|
=====================
|
||||||
|
|
||||||
|
.. class:: BtreeGinExtension()
|
||||||
|
|
||||||
|
.. versionadded:: 1.11
|
||||||
|
|
||||||
|
Install the ``btree_gin`` extension.
|
||||||
|
|
||||||
``HStoreExtension``
|
``HStoreExtension``
|
||||||
===================
|
===================
|
||||||
|
|
||||||
|
|
|
@ -5,10 +5,12 @@ from django.db import migrations
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from django.contrib.postgres.operations import (
|
from django.contrib.postgres.operations import (
|
||||||
CreateExtension, HStoreExtension, TrigramExtension, UnaccentExtension,
|
BtreeGinExtension, CreateExtension, HStoreExtension, TrigramExtension,
|
||||||
|
UnaccentExtension,
|
||||||
)
|
)
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from django.test import mock
|
from django.test import mock
|
||||||
|
BtreeGinExtension = mock.Mock()
|
||||||
CreateExtension = mock.Mock()
|
CreateExtension = mock.Mock()
|
||||||
HStoreExtension = mock.Mock()
|
HStoreExtension = mock.Mock()
|
||||||
TrigramExtension = mock.Mock()
|
TrigramExtension = mock.Mock()
|
||||||
|
@ -18,6 +20,7 @@ except ImportError:
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
|
BtreeGinExtension(),
|
||||||
# Ensure CreateExtension quotes extension names by creating one with a
|
# Ensure CreateExtension quotes extension names by creating one with a
|
||||||
# dash in its name.
|
# dash in its name.
|
||||||
CreateExtension('uuid-ossp'),
|
CreateExtension('uuid-ossp'),
|
||||||
|
|
Loading…
Reference in New Issue