I am trying to model a database where I have 2 inverted foreign keys which both tables fields are required NOT NULL. How can I model that?
Here a small sample:
I have two tables called the first is a generic called "SystemObjects" and the second is called "Users". Each "SystemObject" is created by a "User" object and so require a 'CreatedBy' foreign key which cannot be null. In the same time, all users have also generic associated SystemObject entry and the table "Users" contains more info about those objects with specific type "User".
In OOP analogy, "User" inherits from "SystemObject" and has supplementary members. and so I need to keep track of that connection.
A summary to my problem:
- "A" has a foreign key field to "B"
- "B" has a foreign key field to "A"
- Both are required (NOT NULL)
How to escape this trap? Any alternative Model that would solve my problem and allow me to have this vis-verca tracking?
Thank you!