Hello, I have 4 tables t1,t2,t3 each having 1 column as id and t4 having colum1 and column2 as composite primary key, column1 is a foreign key on t3's primary key, column2 should be a foreign for either t1's primary key or t2's primary key.
The actual situation is that column2 is a foreign key for t1's and t2's primary key but this is always running me into an error of foreignkey constraint.
How can I fix the problem? I know that if I create a new table for each association the problem is solved, but then I should create nearly 20 tables only for this example.
|