29 lines
550 B
Text
29 lines
550 B
Text
|
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")
|
||
|
}
|