Modify

Ticket #311 (closed defect: fixed)

Opened 5 years ago

Last modified 4 years ago

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

comment:1 Changed 4 years ago by andrew

  • Status changed from new to closed
  • Resolution set to fixed
  • Milestone set to 0.7

This got applied somewhere, don't know when.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.