Skip to content

Commit

Permalink
refactor: simplify unique index definition in user schema♻️
Browse files Browse the repository at this point in the history
  • Loading branch information
shivamvijaywargi committed Nov 6, 2024
1 parent 3eb369a commit 6fa2b77
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/db/schema/user.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ const userSchema = pgTable(
.notNull()
.defaultNow(),
},
table => ({
emailUniqueIndex: uniqueIndex().on(lower(table.email)),
}),
table => [uniqueIndex().on(lower(table.email))],
);

// Schema for selecting a user - can be used to validate API responses
Expand Down

0 comments on commit 6fa2b77

Please sign in to comment.