0001_setup_extensions.py 635 B

123456789101112131415161718192021222324
  1. from django.db import migrations
  2. from django.db.migrations.operations.base import Operation
  3. class DummyOperation(Operation):
  4. def state_forwards(self, app_label, state):
  5. pass
  6. def database_forwards(self, app_label, schema_editor, from_state, to_state):
  7. pass
  8. def database_backwards(self, app_label, schema_editor, from_state, to_state):
  9. pass
  10. try:
  11. from django.contrib.postgres.operations import CryptoExtension
  12. except ImportError:
  13. CryptoExtension = DummyOperation
  14. class Migration(migrations.Migration):
  15. # Required for the SHA database functions.
  16. operations = [CryptoExtension()]