Index: django/db/models/fields/__init__.py
===================================================================
--- django/db/models/fields/__init__.py	(revision 4218)
+++ django/db/models/fields/__init__.py	(working copy)
@@ -407,6 +407,9 @@
                 raise validators.ValidationError, gettext_lazy("This field cannot be null.")
         return str(value)
 
+    def get_db_prep_save(self, value):
+        return Field.get_db_prep_save(self, str(value))
+
 # TODO: Maybe move this into contrib, because it's specialized.
 class CommaSeparatedIntegerField(CharField):
     def get_manipulator_field_objs(self):
@@ -509,14 +512,14 @@
             if settings.DATABASE_ENGINE in ('mysql', 'oracle') and hasattr(value, 'microsecond'):
                 value = value.replace(microsecond=0)
             # cx_Oracle wants the raw datetime instead of a string.
-            if settings.DATABASE_ENGINE != 'oracle':
+            if settings.DATABASE_ENGINE not in ('oracle', 'firebird'):
                 value = str(value)
         return Field.get_db_prep_save(self, value)
 
     def get_db_prep_lookup(self, lookup_type, value):
         # Oracle will throw an error if microseconds are given, because it
         # doesn't support microseconds.
-        if settings.DATABASE_ENGINE == 'oracle' and hasattr(value, 'microsecond'):
+        if settings.DATABASE_ENGINE in ('oracle', 'firebird') and hasattr(value, 'microsecond'):
             value = value.replace(microsecond=0)
         if lookup_type == 'range':
             value = [str(v) for v in value]
Index: django/db/models/query.py
===================================================================
--- django/db/models/query.py	(revision 4218)
+++ django/db/models/query.py	(working copy)
@@ -657,7 +657,10 @@
     else:
         cast_sql = '%s'
     try:
-        return '%s%s %s' % (table_prefix, field_name,
+        lookup_sql = '%s%s %s'
+        if (settings.DATABASE_ENGINE == 'firebird' and lookup_type[0] == 'i'):
+            lookup_sql = 'UPPER(%s%s) %s'
+        return lookup_sql % (table_prefix, field_name,
                             backend.OPERATOR_MAPPING[lookup_type] % cast_sql)
     except KeyError:
         pass
Index: django/core/management.py
===================================================================
--- django/core/management.py	(revision 4218)
+++ django/core/management.py	(working copy)
@@ -163,7 +163,7 @@
             # Make the definition (e.g. 'foo VARCHAR(30)') for this field.
             field_output = [style.SQL_FIELD(backend.quote_name(f.column)),
                 style.SQL_COLTYPE(col_type % rel_field.__dict__)]
-            field_output.append(style.SQL_KEYWORD('%sNULL' % (not f.null and 'NOT ' or '')))
+            field_output.append(style.SQL_KEYWORD('%sNULL' % (not f.null and 'NOT ' or 'DEFAULT ')))
             if f.unique and (not f.primary_key or backend.allows_unique_and_pk):
                 field_output.append(style.SQL_KEYWORD('UNIQUE'))
             if f.primary_key:
@@ -1177,7 +1177,7 @@
     index_output = []
     for f in fields:
         field_output = [backend.quote_name(f.name), data_types[f.get_internal_type()] % f.__dict__]
-        field_output.append("%sNULL" % (not f.null and "NOT " or ""))
+        field_output.append("%sNULL" % (not f.null and "NOT " or "DEFAULT "))
         if f.unique:
             field_output.append("UNIQUE")
         if f.primary_key:
Index: tests/runtests.py
===================================================================
--- tests/runtests.py	(revision 4218)
+++ tests/runtests.py	(working copy)
@@ -16,7 +16,7 @@
     'django.contrib.auth',
     'django.contrib.sites',
     'django.contrib.flatpages',
-    'django.contrib.redirects',
+#    'django.contrib.redirects',
     'django.contrib.sessions',
     'django.contrib.comments',
     'django.contrib.admin',
