I created the following db in MySQL:
create table parent1 (
parent_id int,
constraint pk_parent1 primary key (parent_id)
);
create table child1 (
child_id int,
parent_id int not null,
constraint pk_child1 primary key (child_id),
constraint fk_child1_parent1 foreign key (parent_id)
references parent1(parent_id)
);
If I reverse engineer the model in MySQL Workbench, it chooses the parent to be mandatory in the relationship (--|<). I know MySQL has to choose for either mandatory or optional, but mandatory seems the illogical choice for me as this is (1) much more difficult to implement in SQL and (2) less common than a parent with optional children.
- Why does Workbench choose for this interpretation?
- Is there a configuration setting in Workbench to force parent with optiona开发者_Go百科l children?
精彩评论