MySQL Forums
Forum List  »  Newbie

Circular foreign key dependency in Sakila?
Posted by: Robert Sand
Date: May 04, 2018 12:55PM

Hi!

I'm trying to create a new store with a new manager in Sakila, but I've run into a circular problem.

To create a new staff member I need to assign it to a store that I haven't created yet.
To create a new store I need to assign it a manager that I haven't created yet.

Is this supposed to be possible to do without setting foreign_key_checks to 0 or alter the tables to allow null?
No big deal, I can work around it ofcourse, but is there a correct way?

Options: ReplyQuote


Subject
Written By
Posted
Circular foreign key dependency in Sakila?
May 04, 2018 12:55PM


Sorry, only registered users may post in this forum.

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.