server/sources/native.py
changeset 6366 1806148d6ce8
parent 6333 e3994fcc21c3
parent 6359 0bff5a05385c
child 6426 541659c39f6a
--- a/server/sources/native.py	Thu Sep 23 23:28:58 2010 +0200
+++ b/server/sources/native.py	Wed Sep 29 16:16:32 2010 +0200
@@ -142,7 +142,11 @@
     """return backend type and a boolean flag if NULL values should be allowed
     for a given relation definition
     """
-    coltype = y2sql.type_from_constraints(dbhelper, rdef.object,
+    if rdef.object.final:
+        ttype = rdef.object
+    else:
+        ttype = 'Int' # eid type
+    coltype = y2sql.type_from_constraints(dbhelper, ttype,
                                           rdef.constraints, creating=False)
     allownull = rdef.cardinality[0] != '1'
     return coltype, allownull