From 09283870d007189f811105b7ea3c387ec84ffe3f Mon Sep 17 00:00:00 2001
From: Ron Konigsberg <ronkonigsberg@gmail.com>
Date: Mon, 13 Apr 2015 15:01:30 +0300
Subject: [PATCH] bugfix: support defaults which are unhashable (e.g. JsonField
default={})
---
django/db/backends/mysql/schema.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/django/db/backends/mysql/schema.py b/django/db/backends/mysql/schema.py
index 7f3a2d3..6933380 100644
a
|
b
|
def add_field(self, model, field):
|
43 | 43 | super(DatabaseSchemaEditor, self).add_field(model, field) |
44 | 44 | |
45 | 45 | # Simulate the effect of a one-off default. |
46 | | if self.skip_default(field) and field.default not in {None, NOT_PROVIDED}: |
| 46 | if self.skip_default(field) and field.default not in [None, NOT_PROVIDED]: |
47 | 47 | effective_default = self.effective_default(field) |
48 | 48 | self.execute('UPDATE %(table)s SET %(column)s = %%s' % { |
49 | 49 | 'table': self.quote_name(model._meta.db_table), |