Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create unique index migration #64

Merged
merged 2 commits into from
Nov 20, 2018
Merged

Conversation

xilefff
Copy link
Contributor

@xilefff xilefff commented Nov 20, 2018

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

Adds concurrently unique index between friendable_id and friend_id to prevent duplicate friendships.
@xilefff
Copy link
Contributor Author

xilefff commented Nov 20, 2018

@chevinbrown what do you think? :)

@coveralls
Copy link

coveralls commented Nov 20, 2018

Coverage Status

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

@chevinbrown
Copy link
Contributor

@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)

Add the unique index unless it already exists between friendable_id and friend_id.
@xilefff
Copy link
Contributor Author

xilefff commented Nov 20, 2018

Right, just added!

Copy link
Contributor

@chevinbrown chevinbrown left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! 👏

@xilefff
Copy link
Contributor Author

xilefff commented Nov 20, 2018

My pleasure! Thank you! :)

@chevinbrown chevinbrown merged commit 21e7311 into has-friendship:master Nov 20, 2018
@chevinbrown
Copy link
Contributor

We'll bump the version and release after Thanksgiving.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants