invite model

This commit is contained in:
keyan 2021-10-12 15:40:30 -05:00
parent edf9584391
commit 09c4883366
1 changed files with 15 additions and 0 deletions

View File

@ -24,6 +24,9 @@ model User {
actions ItemAct[]
invoices Invoice[]
withdrawls Withdrawl[]
invites Invite[] @relation(name: "Invites")
invite Invite? @relation(fields: [inviteId], references: [id])
inviteId String?
bio Item? @relation(name: "Item", fields: [bioId], references: [id])
bioId Int?
msats Int @default(0)
@ -45,6 +48,18 @@ model LnAuth {
pubkey String?
}
model Invite {
id String @id @default(cuid())
createdAt DateTime @default(now()) @map(name: "created_at")
updatedAt DateTime @default(now()) @updatedAt @map(name: "updated_at")
user User @relation(name: "Invites", fields: [userId], references: [id])
userId Int
gift Int?
limit Int?
revoked Boolean @default(false)
invitees User[]
}
model Message {
id Int @id @default(autoincrement())
text String