Development of an internal social media platform with personalised dashboards for students
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

validation.py 860B

12345678910111213141516171819202122
  1. from django.core import checks
  2. from django.db.backends.base.validation import BaseDatabaseValidation
  3. class DatabaseValidation(BaseDatabaseValidation):
  4. def check_field_type(self, field, field_type):
  5. """Oracle doesn't support a database index on some data types."""
  6. errors = []
  7. if field.db_index and field_type.lower() in self.connection._limited_data_types:
  8. errors.append(
  9. checks.Warning(
  10. 'Oracle does not support a database index on %s columns.'
  11. % field_type,
  12. hint=(
  13. "An index won't be created. Silence this warning if "
  14. "you don't care about it."
  15. ),
  16. obj=field,
  17. id='fields.W162',
  18. )
  19. )
  20. return errors