mirror of
https://github.com/leonvanzyl/agentic-coding-starter-kit.git
synced 2026-01-31 06:42:07 +00:00
Init
This commit is contained in:
47
src/lib/schema.ts
Normal file
47
src/lib/schema.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
import { pgTable, text, timestamp, boolean, primaryKey } from "drizzle-orm/pg-core"
|
||||
|
||||
export const user = pgTable("user", {
|
||||
id: text("id").primaryKey(),
|
||||
name: text("name"),
|
||||
email: text("email").unique(),
|
||||
emailVerified: boolean("emailVerified"),
|
||||
image: text("image"),
|
||||
createdAt: timestamp("createdAt").defaultNow(),
|
||||
updatedAt: timestamp("updatedAt").defaultNow(),
|
||||
})
|
||||
|
||||
export const session = pgTable("session", {
|
||||
id: text("id").primaryKey(),
|
||||
expiresAt: timestamp("expiresAt"),
|
||||
token: text("token").unique(),
|
||||
createdAt: timestamp("createdAt").defaultNow(),
|
||||
updatedAt: timestamp("updatedAt").defaultNow(),
|
||||
ipAddress: text("ipAddress"),
|
||||
userAgent: text("userAgent"),
|
||||
userId: text("userId").references(() => user.id, { onDelete: "cascade" }),
|
||||
})
|
||||
|
||||
export const account = pgTable("account", {
|
||||
id: text("id").primaryKey(),
|
||||
accountId: text("accountId"),
|
||||
providerId: text("providerId"),
|
||||
userId: text("userId").references(() => user.id, { onDelete: "cascade" }),
|
||||
accessToken: text("accessToken"),
|
||||
refreshToken: text("refreshToken"),
|
||||
idToken: text("idToken"),
|
||||
accessTokenExpiresAt: timestamp("accessTokenExpiresAt"),
|
||||
refreshTokenExpiresAt: timestamp("refreshTokenExpiresAt"),
|
||||
scope: text("scope"),
|
||||
password: text("password"),
|
||||
createdAt: timestamp("createdAt").defaultNow(),
|
||||
updatedAt: timestamp("updatedAt").defaultNow(),
|
||||
})
|
||||
|
||||
export const verification = pgTable("verification", {
|
||||
id: text("id").primaryKey(),
|
||||
identifier: text("identifier"),
|
||||
value: text("value"),
|
||||
expiresAt: timestamp("expiresAt"),
|
||||
createdAt: timestamp("createdAt").defaultNow(),
|
||||
updatedAt: timestamp("updatedAt").defaultNow(),
|
||||
})
|
||||
Reference in New Issue
Block a user