mirror of
https://github.com/soconnor0919/hristudio.git
synced 2025-12-11 22:54:45 -05:00
- Upgrade Next.js to version 15.1.7 - Update Drizzle ORM and related dependencies - Add Nodemailer and related type definitions - Refactor authentication routes and components - Modify user schema to include first and last name - Update authentication configuration and session handling - Remove deprecated login and register pages - Restructure authentication-related components and routes
44 lines
1.7 KiB
TypeScript
44 lines
1.7 KiB
TypeScript
import { text, timestamp, varchar, integer } from "drizzle-orm/pg-core";
|
|
import { createTable } from "../utils";
|
|
|
|
export const users = createTable("user", {
|
|
id: varchar("id", { length: 255 }).notNull().primaryKey(),
|
|
email: varchar("email", { length: 255 }).notNull(),
|
|
firstName: varchar("first_name", { length: 255 }),
|
|
lastName: varchar("last_name", { length: 255 }),
|
|
password: varchar("password", { length: 255 }),
|
|
emailVerified: timestamp("emailVerified", { mode: "date" }),
|
|
image: text("image"),
|
|
});
|
|
|
|
export const accounts = createTable("account", {
|
|
userId: varchar("userId", { length: 255 })
|
|
.notNull()
|
|
.references(() => users.id),
|
|
type: varchar("type", { length: 255 })
|
|
.$type<"oauth" | "oidc" | "email">()
|
|
.notNull(),
|
|
provider: varchar("provider", { length: 255 }).notNull(),
|
|
providerAccountId: varchar("providerAccountId", { length: 255 }).notNull(),
|
|
refresh_token: text("refresh_token"),
|
|
access_token: text("access_token"),
|
|
expires_at: integer("expires_at"),
|
|
token_type: varchar("token_type", { length: 255 }),
|
|
scope: varchar("scope", { length: 255 }),
|
|
id_token: text("id_token"),
|
|
session_state: varchar("session_state", { length: 255 }),
|
|
});
|
|
|
|
export const sessions = createTable("session", {
|
|
sessionToken: varchar("sessionToken", { length: 255 }).notNull().primaryKey(),
|
|
userId: varchar("userId", { length: 255 })
|
|
.notNull()
|
|
.references(() => users.id),
|
|
expires: timestamp("expires", { mode: "date" }).notNull(),
|
|
});
|
|
|
|
export const verificationTokens = createTable("verificationToken", {
|
|
identifier: varchar("identifier", { length: 255 }).notNull(),
|
|
token: varchar("token", { length: 255 }).notNull(),
|
|
expires: timestamp("expires", { mode: "date" }).notNull(),
|
|
});
|