-
-
Notifications
You must be signed in to change notification settings - Fork 84
/
schema.py
26 lines (20 loc) · 811 Bytes
/
schema.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import django
if django.VERSION[0:2] >= (1, 8):
from django.db.backends.base.schema import BaseDatabaseSchemaEditor
else:
from django.db.backends.schema import BaseDatabaseSchemaEditor
class CassandraDatabaseSchemaEditor(BaseDatabaseSchemaEditor):
def prepare_default(self, value):
return value
def quote_value(self, value):
return value
def create_model(self, model):
# Hack to disable checking migrations for cassandra connection
try:
from django.db.migrations.exceptions import (
MigrationSchemaMissing as Exc)
except ImportError:
from django.core.exceptions import ImproperlyConfigured as Exc
raise Exception('No schema for cassandra database')
def delete_model(self, model):
pass