Skip to content

Commit

Permalink
Update schema.ts
Browse files Browse the repository at this point in the history
make sure you use the last version of drizzle.
There is a new syntax for setting the compoundKey or the composite of the primarykey
  • Loading branch information
Abdulrahman-AL-Sabagh authored Dec 29, 2023
1 parent 34f4af3 commit cbb9b6a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/db/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const accounts = pgTable(
session_state: text("session_state"),
},
(account) => ({
compoundKey: primaryKey(account.provider, account.providerAccountId),
primaryKey: [account.provider, account.providerAccountId],
})
);

Expand All @@ -57,7 +57,7 @@ export const verificationTokens = pgTable(
expires: timestamp("expires", { mode: "date" }).notNull(),
},
(vt) => ({
compoundKey: primaryKey(vt.identifier, vt.token),
primaryKey: [vt.identifier, vt.token],
})
);

Expand Down

0 comments on commit cbb9b6a

Please sign in to comment.