Commits

and...@69d324d9-c39d-4fdc-8679-7745eae9e2c8  committed a19323b

Fix #125; 1) fields need a column to set types sometimes 2) those types might have keywords after that need stripping.

  • Participants
  • Parent commits 2ea4a5a

Comments (0)

Files changed (1)

File south/db/generic.py

         qn = connection.ops.quote_name
         
         # Add _id or whatever if we need to
+        field.set_attributes_from_name(name)
         if not explicit_name:
-            field.set_attributes_from_name(name)
             name = field.column
 
         # First, change the type
         params = {
             "column": qn(name),
-            "type": field.db_type(),
+            "type": field.db_type().split(" ")[0], # The type might have CHECK... in it.
         }
 
         # SQLs is a list of (SQL, values) pairs.