Fix: schema, move favicon and config page

This commit is contained in:
aronmal 2024-01-11 11:41:37 +01:00
parent 712affc83d
commit 2a1cf8114e
Signed by: aronmal
GPG key ID: 816B7707426FC612
5 changed files with 69 additions and 66 deletions

View file

@ -12,23 +12,22 @@ import {
} from "drizzle-orm/pg-core";
export const users = pgTable("user", {
id: text("id").primaryKey(),
id: text("id").notNull().primaryKey(),
name: text("name"),
email: text("email").notNull(),
emailVerified: timestamp("email_verified", { mode: "date" }),
emailVerified: timestamp("emailVerified", { mode: "date" }),
image: text("image"),
createdAt: timestamp("created_at").defaultNow(),
});
export const accounts = pgTable(
"account",
{
userId: text("user_id")
userId: text("userId")
.notNull()
.references(() => users.id, { onDelete: "cascade" }),
type: text("type").$type<AdapterAccount["type"]>().notNull(),
provider: text("provider").notNull(),
providerAccountId: text("provider_account_id").notNull(),
providerAccountId: text("providerAccountId").notNull(),
refresh_token: text("refresh_token"),
access_token: text("access_token"),
expires_at: integer("expires_at"),
@ -45,15 +44,15 @@ export const accounts = pgTable(
);
export const sessions = pgTable("session", {
sessionToken: text("session_token").primaryKey(),
userId: text("user_id")
sessionToken: text("sessionToken").notNull().primaryKey(),
userId: text("userId")
.notNull()
.references(() => users.id, { onDelete: "cascade" }),
expires: timestamp("expires", { mode: "date" }).notNull(),
});
export const verificationTokens = pgTable(
"verification_token",
"verificationToken",
{
identifier: text("identifier").notNull(),
token: text("token").notNull(),