Files
newsletter-hackernews/prisma/schema.prisma

52 lines
1.1 KiB
Plaintext

generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
model User {
id String @id @default(cuid())
email String @unique
code String @unique
confirmed Boolean @default(false)
deleted Boolean @default(false)
createdAt DateTime @default(now())
lastMail DateTime?
@@map(name: "users")
}
model News {
id Float @id @unique
title String
text String?
type String
by String
time Float
url String?
score Float
createdAt DateTime @default(now())
@@map(name: "news")
}
model EmailLog {
id Int @id @default(autoincrement())
recipient String
subject String?
messageId String? @map("message_id")
status String // 'sent', 'failed', 'bounced'
sentAt DateTime @default(now()) @map("sent_at")
errorMessage String? @map("error_message")
bounceType String? @map("bounce_type")
bounceDetails Json? @map("bounce_details")
@@index([recipient])
@@index([status])
@@index([sentAt])
@@map(name: "email_logs")
}