|
|
|
|
|
by vbsd
1262 days ago
|
|
This Django example is more of a "[one or zero] to [one or zero]" relationship, that's likely what the grandparent post means. I doubt any of the mainstream relational databases have a way to enforce exact one-to-one correspondence between two tables. You could use triggers that execute at the end of transactions or something like that - but that's not part of the relational model. |
|
Yes, you can hack it with a unique constraint, but it's not very elegant.