drwl / annotaterb

A Ruby Gem that adds annotations to your Rails models and route files.
Other
157 stars 16 forks source link

Support postgres NULLS NOT DISTINCT clause in unique index #148

Closed ENewmeration closed 1 month ago

ENewmeration commented 1 month ago

Postgres supports NULLS NOT DISTINCT for unique indexes https://www.postgresql.org/docs/current/indexes-unique.html#INDEXES-UNIQUE

This causes the index to treat nulls as equal which is important information to surface when one of the columns is nullable.

This utilizes nulls_not_distinct in the index definition to surface this information

drwl commented 1 month ago

I'm currently away for the weekend and cannot access my personal device to publish a release, but will aim for Tuesday/Wednesday.

ENewmeration commented 2 weeks ago

thanks for making it easy to test. appreciate you continuing on this project!

drwl commented 2 weeks ago

@ENewmeration no problem and apologies for the delay. I had a big deadline at work and was focused on that -- I published a new gem version 4.12.0 that contains this change.

Let me know if you have any other issues!