Skip to content

Commit

Permalink
Add uniqueness constraint (#133)
Browse files Browse the repository at this point in the history
ProfileWordSummary - wordId and profileId
  • Loading branch information
byronwall authored Oct 31, 2023
1 parent 64e4bc0 commit c3d910c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
Warnings:
- A unique constraint covering the columns `[profileId,wordId]` on the table `ProfileWordSummary` will be added. If there are existing duplicate values, this will fail.
*/
-- CreateIndex
CREATE UNIQUE INDEX "ProfileWordSummary_profileId_wordId_key" ON "ProfileWordSummary"("profileId", "wordId");
3 changes: 3 additions & 0 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@ model ProfileWordSummary {
// interval stored in days
interval Int @default(1)
// unqiue const on profileId and wordId
@@unique([profileId, wordId])
}

// ---- LESSON PLANS ---- //
Expand Down

0 comments on commit c3d910c

Please sign in to comment.