feat: user activation and emails

This commit is contained in:
Riccardo
2023-12-04 16:18:35 +01:00
parent 527fc25c08
commit 37f5692f61
40 changed files with 2093 additions and 310 deletions

View File

@@ -1,15 +1,9 @@
import { PrismaClient } from "@prisma/client";
// PrismaClient is attached to the `global` object in development to prevent
// exhausting your database connection limit.
//
// Learn more:
// https://pris.ly/d/help/next-js-best-practices
import { PrismaClient } from '@prisma/client';
const globalForPrisma = global as unknown as { prisma: PrismaClient };
export const prisma = globalForPrisma.prisma || new PrismaClient();
if (process.env.NODE_ENV !== "production") globalForPrisma.prisma = prisma;
if (process.env.NODE_ENV !== 'production') globalForPrisma.prisma = prisma;
export default prisma;

View File

@@ -3,28 +3,32 @@ generator client {
}
datasource db {
provider = "postgresql"
url = env("POSTGRES_PRISMA_URL") // uses connection pooling
provider = "postgresql"
url = env("POSTGRES_PRISMA_URL") // uses connection pooling
directUrl = env("POSTGRES_URL_NON_POOLING") // uses a direct connection
}
model User {
id String @default(cuid()) @id
email String? @unique
targetingAllowed Boolean @default(false)
createdAt DateTime @default(now()) @map(name: "created_at")
id String @id @default(cuid())
email String @unique
code String @unique
confirmed Boolean @default(false)
deleted Boolean @default(false)
createdAt DateTime @default(now()) @map(name: "created_at")
@@map(name: "users")
}
model News {
id Float @unique @id
title String
text String?
type String
by String
time Float
url String?
score Float
id Float @id @unique
title String
text String?
type String
by String
time Float
url String?
score Float
createdAt DateTime @default(now()) @map(name: "created_at")
@@map(name: "news")
}
}