equal
deleted
inserted
replaced
117 |
117 |
118 def rdef_physical_info(dbhelper, rdef): |
118 def rdef_physical_info(dbhelper, rdef): |
119 """return backend type and a boolean flag if NULL values should be allowed |
119 """return backend type and a boolean flag if NULL values should be allowed |
120 for a given relation definition |
120 for a given relation definition |
121 """ |
121 """ |
122 if rdef.object.final: |
122 if not rdef.object.final: |
123 ttype = rdef.object |
123 return dbhelper.TYPE_MAPPING['Int'] |
124 else: |
124 coltype = y2sql.type_from_rdef(dbhelper, rdef, creating=False) |
125 ttype = 'Int' # eid type |
|
126 coltype = y2sql.type_from_constraints(dbhelper, ttype, |
|
127 rdef.constraints, creating=False) |
|
128 allownull = rdef.cardinality[0] != '1' |
125 allownull = rdef.cardinality[0] != '1' |
129 return coltype, allownull |
126 return coltype, allownull |
130 |
127 |
131 |
128 |
132 class _UndoException(Exception): |
129 class _UndoException(Exception): |