mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Refs #27236 -- Added generic mechanism to handle the deprecation of migration operations.
This commit is contained in:
committed by
Mariusz Felisiak
parent
57793b4765
commit
41019e48bb
@@ -1,11 +1,22 @@
|
||||
from unittest import mock
|
||||
|
||||
from django.db import migrations
|
||||
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
|
||||
|
||||
|
||||
try:
|
||||
from django.contrib.postgres.operations import CryptoExtension
|
||||
except ImportError:
|
||||
CryptoExtension = mock.Mock()
|
||||
CryptoExtension = DummyOperation
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
Reference in New Issue
Block a user