equal
deleted
inserted
replaced
140 |
140 |
141 def rdef_physical_info(dbhelper, rdef): |
141 def rdef_physical_info(dbhelper, rdef): |
142 """return backend type and a boolean flag if NULL values should be allowed |
142 """return backend type and a boolean flag if NULL values should be allowed |
143 for a given relation definition |
143 for a given relation definition |
144 """ |
144 """ |
145 coltype = y2sql.type_from_constraints(dbhelper, rdef.object, |
145 if rdef.object.final: |
|
146 ttype = rdef.object |
|
147 else: |
|
148 ttype = 'Int' # eid type |
|
149 coltype = y2sql.type_from_constraints(dbhelper, ttype, |
146 rdef.constraints, creating=False) |
150 rdef.constraints, creating=False) |
147 allownull = rdef.cardinality[0] != '1' |
151 allownull = rdef.cardinality[0] != '1' |
148 return coltype, allownull |
152 return coltype, allownull |
149 |
153 |
150 class UndoException(Exception): |
154 class UndoException(Exception): |