Modify ↓
Ticket #311 (closed defect: fixed)
Warning: BLOB/TEXT column 'body' can't have a default value
| Reported by: | anonymous | Owned by: | andrew |
|---|---|---|---|
| Priority: | major | Milestone: | 0.7 |
| Component: | commands | Version: | 0.6.2 |
| Keywords: | Cc: |
Description
Get this error when running on mysql:
Warning: BLOB/TEXT column 'body' can't have a default value
This is a fix
--- generic.py 2009-10-05 16:51:12.000000000 +0000
+++ generic.py 2009-10-05 16:52:50.000000000 +0000
@@ -436,7 +436,7 @@
default = "'%s'" % default
sql += " DEFAULT %s"
sqlparams = (default)
- elif (not field.null and field.blank) or field.get_default() == '':
+ elif (not field.null and field.blank) or (field.get_default() == '' and getattr(field, '_suppress_default', True)):
if field.empty_strings_allowed:
sql += " DEFAULT ''"
# Error here would be nice, but doesn't seem to play fair.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

This got applied somewhere, don't know when.