MySQL Forums
Forum List  »  InnoDB

FK - Design problem
Posted by: Harald Bacik
Date: August 30, 2008 02:47AM

Hey

I don't know, where to ask either...

So, I have the following problem, which I can't solve.
I have two completly different offers tables.
These two tables should be referenced with one invoicenumber table.

In both offers tables, I do have an ID field which is set to autoincrement as primary index.

Here seems to be the big problem. - Because, when I set a foreign key in my invoicenumer table, mySQL deletes the offers of both tables.
So, I thought, I could solve this problem when I add a second related column, called offers_type. - This I set to a default value: - In offers table A set to 1 and in offers table B to 2.
In the invoicenumbers table, I do have also added a field with offers_type. - But this is also not working, when I try to add a field, in this case I get an error.

So, how can I set a FK into the invoicenumers table, that this is related to both offers tables. - THX

Plese HELP!!!

Options: ReplyQuote


Subject
Views
Written By
Posted
FK - Design problem
2188
August 30, 2008 02:47AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.