For anyone else stumbling upon this old thread, you can also use postgres’ NULLS NOT DISTINCT option for unique indices to achieve a similar thing without explicitly coercing values (postgres documentation)
EDIT: actually this is built into Ecto.Migration already! Thanks @BrightEyesDavid for pointing out ![]()






















