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 <i...@sanchezortega.es>

Un ordenador no es un televisor ni un microondas, es una herramienta compleja.

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
dev mailing list
dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/dev

Reply via email to