-
Notifications
You must be signed in to change notification settings - Fork 1
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
fix: adds unique index on note and user id of teams table #286
base: main
Are you sure you want to change the base?
Conversation
Tushar504
commented
Jan 25, 2025
•
edited
Loading
edited
- if we add unique key constraints then it won't allow duplicate entry.
- This PR adds unique index on note and user id of teams model described in Issue Closes fix: Fix join route user duplication #285
// Create a unique index on noteId and userId | ||
{ | ||
unique: true, | ||
fields: ['noteId', 'userId'], |
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.
we use underscore column naming in db, either write with underscore here, or add underscored: true
to the model arguments
@@ -103,6 +103,13 @@ export default class TeamsSequelizeStorage { | |||
tableName: this.tableName, | |||
sequelize: this.database, | |||
timestamps: false, | |||
indexes: [ |
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.
make sure, that we have this unique index in migration, if we don't have this index, add it in a new migration
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.
Have you been able to reproduce the problem?
Please provide a detailed explanation of the issue, its root cause, and your solution in the PR description
|