1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

[1.7.x] Fixed #23987 -- Made SQLite SchemaEditor always use effective_default().

Backport of 089047331d from master
This commit is contained in:
Andriy Sokolovskiy
2014-12-15 16:14:39 +02:00
committed by Tim Graham
parent eb632bfba5
commit 1690b92b0d
3 changed files with 31 additions and 2 deletions

View File

@@ -69,8 +69,8 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
# Add in any created fields
for field in create_fields:
body[field.name] = field
# If there's a default, insert it into the copy map
if field.has_default():
# Choose a default and insert it into the copy map
if not isinstance(field, ManyToManyField):
mapping[field.column] = self.quote_value(
self.effective_default(field)
)