added event collector

This commit is contained in:
Ren Amamiya
2023-04-10 15:50:38 +07:00
parent 213d7514d2
commit fabc0e6cc2
9 changed files with 232 additions and 57 deletions

View File

@@ -21,6 +21,8 @@ model Account {
plebs Pleb[]
messages Message[]
notes Note[]
chats Chat[]
channels Channel[]
@@index([pubkey])
}
@@ -66,11 +68,25 @@ model Message {
@@index([pubkey, createdAt])
}
model Chat {
id Int @id @default(autoincrement())
pubkey String @unique
createdAt Int
Account Account @relation(fields: [accountId], references: [id])
accountId Int
@@index([pubkey])
}
model Channel {
id Int @id @default(autoincrement())
eventId String @unique
content String
Account Account @relation(fields: [accountId], references: [id])
accountId Int
@@index([eventId])
}