On Wed, 11 Feb 2009 14:48:58 +0100, Iván Sánchez Ortega <i...@sanchezortega.es> wrote: > 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.
I thought of exactly the same thing while reading El Miércoles post. Marcus _______________________________________________ dev mailing list dev@openstreetmap.org http://lists.openstreetmap.org/listinfo/dev