ui/ health checklist
This commit is contained in:
@@ -1,31 +1,35 @@
|
||||
import { pgTable, text, timestamp, boolean, primaryKey } from "drizzle-orm/pg-core"
|
||||
import { pgTable, text, timestamp, boolean } from "drizzle-orm/pg-core";
|
||||
|
||||
export const user = pgTable("user", {
|
||||
id: text("id").primaryKey(),
|
||||
name: text("name"),
|
||||
email: text("email").unique(),
|
||||
name: text("name").notNull(),
|
||||
email: text("email").notNull().unique(),
|
||||
emailVerified: boolean("emailVerified"),
|
||||
image: text("image"),
|
||||
createdAt: timestamp("createdAt").defaultNow(),
|
||||
updatedAt: timestamp("updatedAt").defaultNow(),
|
||||
})
|
||||
createdAt: timestamp("createdAt").notNull().defaultNow(),
|
||||
updatedAt: timestamp("updatedAt").notNull().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(),
|
||||
expiresAt: timestamp("expiresAt").notNull(),
|
||||
token: text("token").notNull().unique(),
|
||||
createdAt: timestamp("createdAt").notNull().defaultNow(),
|
||||
updatedAt: timestamp("updatedAt").notNull().defaultNow(),
|
||||
ipAddress: text("ipAddress"),
|
||||
userAgent: text("userAgent"),
|
||||
userId: text("userId").references(() => user.id, { onDelete: "cascade" }),
|
||||
})
|
||||
userId: text("userId")
|
||||
.notNull()
|
||||
.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" }),
|
||||
accountId: text("accountId").notNull(),
|
||||
providerId: text("providerId").notNull(),
|
||||
userId: text("userId")
|
||||
.notNull()
|
||||
.references(() => user.id, { onDelete: "cascade" }),
|
||||
accessToken: text("accessToken"),
|
||||
refreshToken: text("refreshToken"),
|
||||
idToken: text("idToken"),
|
||||
@@ -33,15 +37,15 @@ export const account = pgTable("account", {
|
||||
refreshTokenExpiresAt: timestamp("refreshTokenExpiresAt"),
|
||||
scope: text("scope"),
|
||||
password: text("password"),
|
||||
createdAt: timestamp("createdAt").defaultNow(),
|
||||
updatedAt: timestamp("updatedAt").defaultNow(),
|
||||
})
|
||||
createdAt: timestamp("createdAt").notNull().defaultNow(),
|
||||
updatedAt: timestamp("updatedAt").notNull().defaultNow(),
|
||||
});
|
||||
|
||||
export const verification = pgTable("verification", {
|
||||
id: text("id").primaryKey(),
|
||||
identifier: text("identifier"),
|
||||
value: text("value"),
|
||||
expiresAt: timestamp("expiresAt"),
|
||||
identifier: text("identifier").notNull(),
|
||||
value: text("value").notNull(),
|
||||
expiresAt: timestamp("expiresAt").notNull(),
|
||||
createdAt: timestamp("createdAt").defaultNow(),
|
||||
updatedAt: timestamp("updatedAt").defaultNow(),
|
||||
})
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user