I have the following tables:
user, logbook,user_logbook
A user log is a connection table ( isCrossRef="true"in schema.xml) containing foreign keys user_idand logbook_id.
I also wanted to remember the current selected log for any given user, so I placed it current_logbook_idin my table userand gave this foreign key. However, in my file BaseUserQuery.phpI get two functions filterByLogbook().
I know that when you have two foreign keys in one table, you get functions like getUserRelatedBySomething()and from one table getUserRelatedBySomethingElse(), but what is better to do in this situation?
I can, of course, just delete the foreign key and just use the stored identifier, or, I suppose, I could create a new connection table (although this does not seem correct). What is the best thing to do in this situation in terms of “working correctly” in MySQL and Propel (I hope I can do both!).
source
share