From aca956eba7a93bfb15da4ae3e1d171615aa08561 Mon Sep 17 00:00:00 2001 From: Reilly Featherstone Date: Sat, 2 Aug 2025 22:04:34 +0100 Subject: [PATCH] docs: Fix composite primary key syntax in examples With the previous syntax, when generating the schema, drizzle wouldn't create composite primary keys. --- .../getting-started/adapters/drizzle.mdx | 27 +++++++++---------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/docs/pages/getting-started/adapters/drizzle.mdx b/docs/pages/getting-started/adapters/drizzle.mdx index 8a84b1fc02..f4006342a3 100644 --- a/docs/pages/getting-started/adapters/drizzle.mdx +++ b/docs/pages/getting-started/adapters/drizzle.mdx @@ -90,11 +90,10 @@ export const accounts = pgTable( session_state: text("session_state"), }, (account) => [ - { - compoundKey: primaryKey({ - columns: [account.provider, account.providerAccountId], - }), - }, + primaryKey({ + name: "compoundKey", + columns: [account.provider, account.providerAccountId], + }), ] ) @@ -114,11 +113,10 @@ export const verificationTokens = pgTable( expires: timestamp("expires", { mode: "date" }).notNull(), }, (verificationToken) => [ - { - compositePk: primaryKey({ - columns: [verificationToken.identifier, verificationToken.token], - }), - }, + primaryKey({ + name: "compositePk", + columns: [verificationToken.identifier, verificationToken.token], + }), ] ) @@ -137,11 +135,10 @@ export const authenticators = pgTable( transports: text("transports"), }, (authenticator) => [ - { - compositePK: primaryKey({ - columns: [authenticator.userId, authenticator.credentialID], - }), - }, + primaryKey({ + name: "compositePK", + columns: [authenticator.userId, authenticator.credentialID], + }), ] ) ```