Raheel
Raheel
DTDrizzle Team
Created by Raheel on 11/23/2024 in #help
0.36.0 - The third parameter in Drizzle ORM becomes an array
Hello guys, I'm trying to setup Auth.js with Neon Postgres + Drizzle Adapter. The example given at think link: https://github.com/drizzle-team/drizzle-orm/releases/tag/0.36.0 for third param becomes an array is too basic for me to understand how do I change Auth.js schemas for accounts and sessions table to work with new version of Drizzle. I'd very much appreciate if someone can change the following schema from object to array for third param i.e. setting up a compound primary key. Thank you. export const accounts = pgTable( "account", { userId: text("userId") .notNull() .references(() => users.id, { onDelete: "cascade" }), type: text("type").$type<AdapterAccountType>().notNull(), provider: text("provider").notNull(), providerAccountId: text("providerAccountId").notNull(), refresh_token: text("refresh_token"), access_token: text("access_token"), expires_at: integer("expires_at"), token_type: text("token_type"), scope: text("scope"), id_token: text("id_token"), session_state: text("session_state"), }, (account) => ({ compoundKey: primaryKey({ columns: [account.provider, account.providerAccountId], }), }) )
7 replies