mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Fixed #21783: More SQLite default fun with nulls.
This commit is contained in:
@@ -223,12 +223,12 @@ class DatabaseOperations(BaseDatabaseOperations):
|
||||
except _sqlite3.ProgrammingError:
|
||||
pass
|
||||
# Manual emulation of SQLite parameter quoting
|
||||
if isinstance(value, six.integer_types):
|
||||
if isinstance(value, type(True)):
|
||||
return str(int(value))
|
||||
elif isinstance(value, six.integer_types):
|
||||
return str(value)
|
||||
elif isinstance(value, six.string_types):
|
||||
return '"%s"' % six.text_type(value)
|
||||
elif isinstance(value, type(True)):
|
||||
return str(int(value))
|
||||
elif value is None:
|
||||
return "NULL"
|
||||
else:
|
||||
|
||||
@@ -30,7 +30,7 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
|
||||
for field in create_fields:
|
||||
body[field.name] = field
|
||||
# If there's a default, insert it into the copy map
|
||||
if field.get_default():
|
||||
if field.has_default():
|
||||
mapping[field.column] = self.connection.ops.quote_parameter(
|
||||
field.get_default()
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user