Hi I just downloaded and am trying out Power Architect. So far it looks awesome! Thanks for your hard work.
I have a question about relationships. I have two tables that are actually a one to zero or one relationship. It appears that this is not possible to model, am I correct?
The answer is, you can model it. However, there's no particular enforcement of 1-to-1 when you forward engineer to the database. So it comes out in your database just like the default 1-to-many relationship: as a foreign key constraint.
I'm not aware of any portable way to represent a one-to-one constraint (as opposed to one-to-many) in SQL. If you have any suggestions along these lines, we're definitely listening!
I've attached a picture of a one-to-one relationship along with the associated relationship properties dialog.
The screenshot I just posted will forward engineer as an enforced one-to-zero-or-one constraint. You can't have duplicate a_id records in Table_B, because a_id is the primary key.
There's nothing special about the foreign key created by the relationship; it's the fact that the child table's primary key is the same as the parent's.
Come to think of it, we should recognise this pattern when reverse engineering, and set the relationship cardinality accordingly.
Thanks Jonathan! I saw that after I posted and that's what I ended up using. We have a legacy system that I am trying to model that actually has 1 to 1. Zero is not an option, but it's enforced by code...