On 16/07/2008, at 8:57 AM, Jeremy Evans wrote: > Not that I'd be a user of the feature, since I prefer all tables have > a surrogate primary key.
A common use of FPKs is to handle subtyping. A base class is mapped to one table, perhaps with a surrogate key, and the additional columns for a subclass are mapped to a second table, which uses the *same* key value as the row that contains the base class values. This is not a usage that ActiveRecord facilitates, but it's a perfectly valid choice. The FPK is a surrogate, but one that's derived and allocated in another table. Another common usage is in join tables, where two (or more) FKs make up a PK. It's really bad form (though widely accepted) to add a surrogate key to such a table. Clifford Heath. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sequel-talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sequel-talk?hl=en -~----------~----~----~----~------~----~------~--~---
