Commits

Maximiliano Robaina committed 1267079

Firebird: fix for booleans default values. Fix for autoinc with db_column field

  • Participants
  • Parent commits ffbfab5

Comments (0)

Files changed (1)

File south/db/firebird.py

 
             columns.append(col)
             if isinstance(field, models.AutoField):
+                field_name = field.db_column or field.column
                 autoinc_sql = connection.ops.autoinc_sql(table_name, field_name)
 
         sql = 'CREATE TABLE %s (%s);' % (qn, ', '.join([col for col in columns]))
                             default = "'%s'" % default.replace("'", "''")
                         elif isinstance(default, (datetime.date, datetime.time, datetime.datetime)):
                             default = "'%s'" % default
+                        elif isinstance(default, bool):
+                            default = int(default)
                         # Escape any % signs in the output (bug #317)
                         if isinstance(default, basestring):
                             default = default.replace("%", "%%")