Skip to content

Commit

Permalink
Update AdapterAccountType import to AdapterAccount.
Browse files Browse the repository at this point in the history
  • Loading branch information
zorro901 committed May 11, 2024
1 parent 117110f commit af054a6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions docs/pages/getting-started/adapters/drizzle.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ import {
} from "drizzle-orm/pg-core"
import postgres from "postgres"
import { drizzle } from "drizzle-orm/postgres-js"
import type { AdapterAccountType } from "next-auth/adapters"
import type { AdapterAccount } from "next-auth/adapters"

const connectionString = "postgres://postgres:postgres@localhost:5432/drizzle"
const pool = postgres(connectionString, { max: 1 })
Expand All @@ -77,7 +77,7 @@ export const accounts = pgTable(
userId: text("userId")
.notNull()
.references(() => users.id, { onDelete: "cascade" }),
type: text("type").$type<AdapterAccountType>().notNull(),
type: text("type").$type<AdapterAccount["type"]>().notNull(),
provider: text("provider").notNull(),
providerAccountId: text("providerAccountId").notNull(),
refresh_token: text("refresh_token"),
Expand Down Expand Up @@ -130,7 +130,7 @@ import {
} from "drizzle-orm/mysql-core"
import mysql from "mysql2/promise"
import { drizzle } from "drizzle-orm/mysql2"
import type { AdapterAccountType } from "next-auth/adapters"
import type { AdapterAccount } from "next-auth/adapters"

export const connection = await mysql.createConnection({
host: "host",
Expand Down Expand Up @@ -161,7 +161,7 @@ export const accounts = mysqlTable(
.notNull()
.references(() => users.id, { onDelete: "cascade" }),
type: varchar("type", { length: 255 })
.$type<AdapterAccountType>()
.$type<AdapterAccount["type"]>()
.notNull(),
provider: varchar("provider", { length: 255 }).notNull(),
providerAccountId: varchar("providerAccountId", { length: 255 }).notNull(),
Expand Down Expand Up @@ -209,7 +209,7 @@ If you want to modify the schema or add additional fields, you can use the follo
import { integer, sqliteTable, text, primaryKey } from "drizzle-orm/sqlite-core"
import { createClient } from "@libsql/client"
import { drizzle } from "drizzle-orm/libsql"
import type { AdapterAccountType } from "next-auth/adapters"
import type { AdapterAccount } from "next-auth/adapters"

const client = createClient({
url: "DATABASE_URL",
Expand All @@ -233,7 +233,7 @@ export const accounts = sqliteTable(
userId: text("userId")
.notNull()
.references(() => users.id, { onDelete: "cascade" }),
type: text("type").$type<AdapterAccountType>().notNull(),
type: text("type").$type<AdapterAccount["type"]>().notNull(),
provider: text("provider").notNull(),
providerAccountId: text("providerAccountId").notNull(),
refresh_token: text("refresh_token"),
Expand Down

0 comments on commit af054a6

Please sign in to comment.