nextauthjs / next-auth

Authentication for the Web.
https://authjs.dev
ISC License
24.96k stars 3.52k forks source link

Incorrect Drizzle Schema #10710

Closed Lodimup closed 6 months ago

Lodimup commented 6 months ago

What is the improvement or update you wish to see?

Incorrect Drizzle Schema present in the doc. The following set of code is incorrect and is different from '@auth/drizzle-adapter'

import {
  timestamp,
  pgTable,
  text,
  primaryKey,
  integer,
} from "drizzle-orm/pg-core"
import type { AdapterAccount } from "next-auth/adapters"
import { randomUUID } from "crypto"

export const users = pgTable("user", {
  id: text("id").primaryKey().$defaultFn(() => randomUUID()),
  name: text("name"),
  email: text("email").notNull().unique(),
  emailVerified: timestamp("emailVerified", { mode: "date" }),
  image: text("image"),
})

... and more

Is there any context that might help us understand?

mirror @auth/drizzle-adapter

Does the docs page already exist? Please link to it.

https://authjs.dev/getting-started/adapters/drizzle

Lodimup commented 6 months ago

Screenshot 2024-04-24 at 20 25 24

additional errors

ndom91 commented 6 months ago

Thanks for pointing this out, the drizzle adapter has had a good bti of changes the last few days.

The docs shuold now be up to date with @auth/drizzle-adapter@1.0.1 :pray: