server/schema2sql.py
changeset 10201 989bbadbcd8d
parent 10199 218c28bff695
child 10202 aaabcb64f77f
equal deleted inserted replaced
10200:cceb2c7c02f4 10201:989bbadbcd8d
   115         rschema, attrschema = attrs[i]
   115         rschema, attrschema = attrs[i]
   116         if attrschema is not None:
   116         if attrschema is not None:
   117             sqltype = aschema2sql(dbhelper, eschema, rschema, attrschema,
   117             sqltype = aschema2sql(dbhelper, eschema, rschema, attrschema,
   118                                   indent=' ')
   118                                   indent=' ')
   119         else: # inline relation
   119         else: # inline relation
   120             # XXX integer is ginco specific
   120             sqltype = 'integer REFERENCES entities (eid)'
   121             sqltype = 'integer'
       
   122         if i == len(attrs) - 1:
   121         if i == len(attrs) - 1:
   123             w(' %s%s %s' % (prefix, rschema.type, sqltype))
   122             w(' %s%s %s' % (prefix, rschema.type, sqltype))
   124         else:
   123         else:
   125             w(' %s%s %s,' % (prefix, rschema.type, sqltype))
   124             w(' %s%s %s,' % (prefix, rschema.type, sqltype))
   126     w(');')
   125     w(');')