diff options
| author | Anssi Kääriäinen <akaariai@gmail.com> | 2012-04-29 19:25:46 +0300 |
|---|---|---|
| committer | Anssi Kääriäinen <akaariai@gmail.com> | 2012-04-29 19:25:46 +0300 |
| commit | 584e2c03376895aeb0404cc1fcc1ad24dfdbc58e (patch) | |
| tree | d191c71b3a8a6f9788658562be0f42e44816952c /django/db/models/fields | |
| parent | e75bd7e51cd6fe1f02fcdb438d58770917116c8f (diff) | |
Prevent Oracle from changing field.null to True
Fixed #17957 -- when using Oracle and character fields, the fields
were set null = True to ease the handling of empty strings. This
caused problems when using multiple databases from different vendors,
or when the character field happened to be also a primary key.
The handling was changed so that NOT NULL is not emitted on Oracle
even if field.null = False, and field.null is not touched otherwise.
Thanks to bhuztez for the report, ramiro for triaging & comments,
ikelly for the patch and alex for reviewing.
Diffstat (limited to 'django/db/models/fields')
| -rw-r--r-- | django/db/models/fields/__init__.py | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/django/db/models/fields/__init__.py b/django/db/models/fields/__init__.py index dc4495390a..5a5e6cc8c3 100644 --- a/django/db/models/fields/__init__.py +++ b/django/db/models/fields/__init__.py @@ -85,11 +85,6 @@ class Field(object): self.primary_key = primary_key self.max_length, self._unique = max_length, unique self.blank, self.null = blank, null - # Oracle treats the empty string ('') as null, so coerce the null - # option whenever '' is a possible value. - if (self.empty_strings_allowed and - connection.features.interprets_empty_strings_as_nulls): - self.null = True self.rel = rel self.default = default self.editable = editable |
