2017-01-19 12:16:04 -05:00
|
|
|
from unittest import mock
|
|
|
|
|
2014-11-04 11:27:35 -05:00
|
|
|
from django.db import migrations
|
2014-03-14 17:34:49 +00:00
|
|
|
|
2015-04-04 18:10:26 +02:00
|
|
|
try:
|
|
|
|
from django.contrib.postgres.operations import (
|
2019-10-18 10:08:50 +01:00
|
|
|
BloomExtension, BtreeGinExtension, BtreeGistExtension, CITextExtension,
|
2017-07-01 15:30:34 +02:00
|
|
|
CreateExtension, CryptoExtension, HStoreExtension, TrigramExtension,
|
|
|
|
UnaccentExtension,
|
2015-04-04 18:10:26 +02:00
|
|
|
)
|
|
|
|
except ImportError:
|
2019-10-18 10:08:50 +01:00
|
|
|
BloomExtension = mock.Mock()
|
2016-08-08 08:45:08 +05:30
|
|
|
BtreeGinExtension = mock.Mock()
|
2017-07-01 15:30:34 +02:00
|
|
|
BtreeGistExtension = mock.Mock()
|
2017-04-25 18:49:29 -04:00
|
|
|
CITextExtension = mock.Mock()
|
2016-04-25 16:30:48 -07:00
|
|
|
CreateExtension = mock.Mock()
|
2017-03-29 23:52:42 +02:00
|
|
|
CryptoExtension = mock.Mock()
|
2015-04-04 18:10:26 +02:00
|
|
|
HStoreExtension = mock.Mock()
|
2015-06-05 17:37:48 +01:00
|
|
|
TrigramExtension = mock.Mock()
|
2015-04-04 18:10:26 +02:00
|
|
|
UnaccentExtension = mock.Mock()
|
|
|
|
|
2014-03-14 17:34:49 +00:00
|
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
|
|
|
|
operations = [
|
2019-10-18 10:08:50 +01:00
|
|
|
BloomExtension(),
|
2016-08-08 08:45:08 +05:30
|
|
|
BtreeGinExtension(),
|
2017-07-01 15:30:34 +02:00
|
|
|
BtreeGistExtension(),
|
2017-04-25 18:49:29 -04:00
|
|
|
CITextExtension(),
|
2016-04-25 16:30:48 -07:00
|
|
|
# Ensure CreateExtension quotes extension names by creating one with a
|
|
|
|
# dash in its name.
|
|
|
|
CreateExtension('uuid-ossp'),
|
2017-03-29 23:52:42 +02:00
|
|
|
CryptoExtension(),
|
2014-03-14 17:34:49 +00:00
|
|
|
HStoreExtension(),
|
2015-06-05 17:37:48 +01:00
|
|
|
TrigramExtension(),
|
2014-09-05 22:53:11 +02:00
|
|
|
UnaccentExtension(),
|
2014-03-14 17:34:49 +00:00
|
|
|
]
|