Skip to content

Commit 0d61638

Browse files
committed
fix: adds unique index on note and user id of teams table
1 parent 27cc4a7 commit 0d61638

File tree

1 file changed

+7
-0
lines changed
  • src/repository/storage/postgres/orm/sequelize

1 file changed

+7
-0
lines changed

src/repository/storage/postgres/orm/sequelize/teams.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,13 @@ export default class TeamsSequelizeStorage {
103103
tableName: this.tableName,
104104
sequelize: this.database,
105105
timestamps: false,
106+
indexes: [
107+
// Create a unique index on noteId and userId
108+
{
109+
unique: true,
110+
fields: ['noteId', 'userId'],
111+
},
112+
],
106113
});
107114
}
108115

0 commit comments

Comments
 (0)