mirror of https://github.com/sgoudham/Enso-Bot.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
860 B
Python
23 lines
860 B
Python
5 years ago
|
from django.core import checks
|
||
|
from django.db.backends.base.validation import BaseDatabaseValidation
|
||
|
|
||
|
|
||
|
class DatabaseValidation(BaseDatabaseValidation):
|
||
|
def check_field_type(self, field, field_type):
|
||
|
"""Oracle doesn't support a database index on some data types."""
|
||
|
errors = []
|
||
|
if field.db_index and field_type.lower() in self.connection._limited_data_types:
|
||
|
errors.append(
|
||
|
checks.Warning(
|
||
|
'Oracle does not support a database index on %s columns.'
|
||
|
% field_type,
|
||
|
hint=(
|
||
|
"An index won't be created. Silence this warning if "
|
||
|
"you don't care about it."
|
||
|
),
|
||
|
obj=field,
|
||
|
id='fields.W162',
|
||
|
)
|
||
|
)
|
||
|
return errors
|