-
Notifications
You must be signed in to change notification settings - Fork 181
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
Feat/unique index #743
base: master
Are you sure you want to change the base?
Feat/unique index #743
Conversation
77b28d1
to
31c0725
Compare
Signed-off-by: Muhammad Aaqil <[email protected]>
3c891f0
to
3f60fb7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aaqilniz, thanks for creating this PR. I've reviewed the changes and had a comment. However, I'm not familiar with postgresql enough to review the main change of this PR (i.e. buildQueryUniqueKeys
function). It would be good to have someone like @samarpanB to review. Thanks.
@@ -276,6 +276,7 @@ CREATE TABLE "user" ( | |||
email character varying(100) | |||
); | |||
|
|||
ALTER TABLE "user" ADD CONSTRAINT user_email_unique UNIQUE (email); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it better to:
ALTER TABLE "user" ADD UNIQUE (email);
Reference: https://www.beekeeperstudio.io/blog/guide-to-unique-constraints-in-postgresql
Checklist
npm test
passes on your machine