[OSM-dev] Rantings about API 0.6

Iván Sánchez Ortega ivan at sanchezortega.es
Wed Feb 11 13:48:58 GMT 2009


El Miércoles, 11 de Febrero de 2009, Stefan de Konink escribió:
> > I'm not a foreign keys guru myself but I think it may be difficult to
> > have one with the relation_members as designed currently.
>
> I have solved that by splitting the members in 3 distinct tables; but
> placed an explicit index so I can always retrieve the members in the
> order they were inserted.

It can also be solved by nuking the "member_type" and "member_id" columns, and 
putting three new columns: "member_node_id", "member_way_id" 
and "member_relation_id", all allowing NULL, with a foreign key to the 
corresponding table, and with a cute custom constraint or even a view to make 
sure two of these three columns are kept NULL.

-- 
----------------------------------
Iván Sánchez Ortega <ivan at sanchezortega.es>

Un ordenador no es un televisor ni un microondas, es una herramienta compleja.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20090211/2ad53e32/attachment.pgp>


More information about the dev mailing list