has-friendship / has_friendship

Add friendship to ActiveRecord models
MIT License
198 stars 98 forks source link

Create unique index migration #64

Closed xilefff closed 6 years ago

xilefff commented 6 years ago

Adds concurrently unique index between friendable_id and friend_id to prevent duplicate friendships.

xilefff commented 6 years ago

@chevinbrown what do you think? :)

coveralls commented 6 years ago

Coverage Status

Coverage remained the same at 99.762% when pulling 980d1eddcdaf2fb5a82f172f24f8d4b22d95d9fd on xilefff:patch-2 into 75c78238747f10a83240507c906530f3fcc366e2 on sungwoncho:master.

chevinbrown commented 6 years ago

@xilefff looks much better! Will this run if indices exist? My only other concern is that some users of this gem may have added those on their own. unless index_exists? (:friendable_id, :friend_id)

xilefff commented 6 years ago

Right, just added!

xilefff commented 6 years ago

My pleasure! Thank you! :)

chevinbrown commented 6 years ago

We'll bump the version and release after Thanksgiving.