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

Feat/unique index #743

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

aaqilniz
Copy link
Contributor

@aaqilniz aaqilniz commented Feb 11, 2025

Checklist

  • DCO (Developer Certificate of Origin) signed in all commits
  • npm test passes on your machine
  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style guide
  • Commit messages are following our guidelines

@aaqilniz aaqilniz force-pushed the feat/unique-index branch from 3c891f0 to 3f60fb7 Compare March 13, 2025 17:44
@aaqilniz aaqilniz marked this pull request as ready for review March 13, 2025 17:44
@aaqilniz
Copy link
Contributor Author

aaqilniz commented Mar 13, 2025

Hi, @dhmlau. Can you have a look at the PR? This should fix issue #748 and the failing tests in PRs #736 & #737.

Sorry for the super delays on this fix.

Copy link
Member

@dhmlau dhmlau left a 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);
Copy link
Member

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

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.

2 participants