Dear Kind Soul,

I am stuck with the following database referential integrity
constraint problem.

I have two tables:
things(thingid INTEGER, thing_name VARCHAR, language CHAR(5))
and
thing_relations(thingid INTEGER, thing_parentid INTEGER)

things hosts items in different languages, e.g.:
things(1, 'car', 'en_US'); things(1, 'voiture', 'fr_FR');
things(2, 'engine', 'en_US'); things(2, 'moteur', 'fr_FR');
things(3, 'brake', 'en_US'); things(3, 'freins', 'fr_FR');

while thing_relations describes the "consists of" relationship between
things, e.g.:
thing_relations(2, 1);
thing_relations(3, 1)
as engine and brake are parts of a car

but since things(thingid) is not unique hence it can't be the primary
key in "things" and can't be the foreign key in "thing_relations", how
can the referential integrity constraints between
thing_relations(thingid) and things(thingid) be described? Or my
design is not making sense?

Many thanks in advance.

Jerry
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to