I have a question in MySQL workbench.

How can I make a relation 1 to 0..1 represented visually?

I only found this symbol:

有帮助吗?

解决方案

This isn't obvious, but to make a 1:1 into a 1:0-1 you have to change the 'mandatory' checkbox in the relationship editor.

First, click on the 1:1 tool, then click on the column in the table you wish to be on the '0' side of the relationship, followed by the column on the '1' side. Now, double-click the connector line, and in the editor window under the 'foreign key' tab, uncheck the 'mandatory' checkbox on the '0' side of the relationship. The symbol on the diagram should change appropriately.

Hope that helps.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top