When two tables have a many-to-many relationship or when a table has a many-to-many relationship with itself we can model that with a junction table.
However the type of the relationship can expend beyond the original type, for example:
Requirements: we have users. each user can have 0 or more other users as friends
Solution: a users table and a junction table called "user_user".
Then we discover a new requirement: some friendships are romantic or in other words two users can be connected in a different way than friendship.
Solution a: add a column to the junction table that contains the type of friendship (friend | partner | ex-friend) and so on.
Solution b: rename the 'user_user' table to 'friendships' (that would have been a better name to start with with this approach) and create a new table called romances, also connecting a user to a user.
Then we discover yet another new requirement: users can owe other users money. Again we can piggyback on the same junction table or create a new one called 'debts'. This time my intuition is 100% to have a separate table.
Every time we discover a new type of relationship or a sub-type of a know relationship we can add a column to the one junction table or create a new junction table.
My question is, what is a good rule to decide when a new table must be created?
Is it when we must have more then a single row per ordered pair? For example if past relationships are never deleted so if two users have been friends in the past for two years, lost contact, and then re-befriended we want to have the old row as well with a start and end date, but having two rows makes the other column information duplicated (old row shows a user owes money, the new one doesn't).
Is it when the extra column is not logically a definition of a single type of relationship?
OK:start of friendship date is related directly to the friendship 1 to 1
Not OK: column for how much money one user owns another user can be 1 to 1 for the relationship but logically is not a description of the friendship.
If we know in advance that two tables are going to have a lot of many to many relationship, is it a reason to plan for many junctions tables or to make a single junction table that is more flexible (even if the type of the connection is not arbitrary)?