Join Tables and Primary Keys
I have found that many people set up the primary keys for join tables in a manner that I find undesirable. This leaves open the possibility of some sneaky bugs in their programs.
I'll start by covering what I mean by a join table (as opposed to what I will call a data table).
Most basic data is stored in data tables. For example a "users" table is a data table, as is a "groups" table. Each row in a "users" table represents one user, as each row in a "groups" table would represent a group.
I assume you mean Transfer. Fortunately, Mark said he would be adding support for compound primary keys soon.
Rob,
Agreed. I have actually seen this several times (hence the entry).
mmh wonder if Active Records supports compound keys...
ALTER TABLE `user2groups` ADD UNIQUE ( `user_id` , `group_id` );