api.npub.email/prisma/schema.prisma

29 lines
550 B
Text
Raw Normal View History

2024-12-02 13:28:00 +00:00
generator client {
provider = "prisma-client-js"
previewFeatures = ["driverAdapters"]
}
datasource db {
provider = "sqlite"
url = env("DB_URL")
}
model User {
npub String @id
registeredAt DateTime @default(now())
lastPayment DateTime @default(now())
subscriptionDuration Int?
aliases Alias[]
@@map("users")
}
model Alias {
npub String
alias String @unique
user User @relation(fields: [npub], references: [npub])
@@id([npub, alias])
@@map("aliases")
}