That was a bad idea from me. Active record is designed to handle relations with foreign keys pointing to primary keys.

With the current implementation, you cannot make reference to non-primary fields. I suggest you to change tu_uid to tu_id, so that your primary field values are used to define this relation. Your table size will also be smaller this way.

Besides, I do not understand why you have two columns that uniquely identify a data set. You can just skip 'u_id' because this column does not provide any more information according to a relation, because you already have a primary key that does exactly that.

That was a bad idea from me. Active record is designed to handle relations with foreign keys pointing to primary keys.

oh, thx for the information.

Dave, on 03 September 2009 - 05:56 AM, said:

Besides, I do not understand why you have two columns that uniquely identify a data set. You can just skip 'u_id' because this column does not provide any more information according to a relation, because you already have a primary key that does exactly that.