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