2019-03-20 18:30:43 +00:00
|
|
|
from django.db import migrations
|
2022-07-02 17:55:37 +00:00
|
|
|
from django.db.migrations.operations.base import Operation
|
|
|
|
|
|
|
|
|
|
|
|
class DummyOperation(Operation):
|
|
|
|
def state_forwards(self, app_label, state):
|
|
|
|
pass
|
|
|
|
|
|
|
|
def database_forwards(self, app_label, schema_editor, from_state, to_state):
|
|
|
|
pass
|
|
|
|
|
|
|
|
def database_backwards(self, app_label, schema_editor, from_state, to_state):
|
|
|
|
pass
|
|
|
|
|
2019-03-20 18:30:43 +00:00
|
|
|
|
|
|
|
try:
|
|
|
|
from django.contrib.postgres.operations import CryptoExtension
|
|
|
|
except ImportError:
|
2022-07-02 17:55:37 +00:00
|
|
|
CryptoExtension = DummyOperation
|
2019-03-20 18:30:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
# Required for the SHA database functions.
|
|
|
|
operations = [CryptoExtension()]
|