1:1 constraint on foreign key

Why implement this with triggers and select count(*) ... mySQL doesn't even support this (at least not in all versions)

Why not use an unique index on the fk field instead? I've always done it this way...



Login or register to post comments

Comments

Thanks

The trigger method to enforce 1:1 constraint is only available in PG schema. We don't have a solution in MySQL schema yet.

Making unique index on fk sounds a good idea and it should work well under both PG and MySQL.

We'll improve it the way you suggested.

Cheers!

Great

Otherwise schemabank looks very nice ... webgui certainly has pros and cons, but it sure looks nifty :-) Also smart to support PG from the start, I think MySQL will fade away, too much noise ...