Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Remove keep_default from add_field

  • Loading branch information...
commit b4c493ecd3b8d0d55347949984561762ad2ef1dc 1 parent d985fd7
@andrewgodwin andrewgodwin authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 django/db/backends/schema.py
View
4 django/db/backends/schema.py
@@ -318,7 +318,7 @@ def alter_db_tablespace(self, model, old_db_tablespace, new_db_tablespace):
"new_tablespace": self.quote_name(new_db_tablespace),
})
- def add_field(self, model, field, keep_default=False):
+ def add_field(self, model, field):
"""
Creates a field on a model.
Usually involves adding a column, but may involve adding a
@@ -345,7 +345,7 @@ def add_field(self, model, field, keep_default=False):
self.execute(sql, params)
# Drop the default if we need to
# (Django usually does not use in-database defaults)
- if not keep_default and field.default is not None:
+ if field.default is not None:
sql = self.sql_alter_column % {
"table": self.quote_name(model._meta.db_table),
"changes": self.sql_alter_column_no_default % {
Please sign in to comment.
Something went wrong with that request. Please try again.