2023-04-02 01:30:36 +00:00
|
|
|
datasource db {
|
|
|
|
provider = "sqlite"
|
2023-04-03 08:03:07 +00:00
|
|
|
url = "file:../../lume.db"
|
2023-04-02 01:30:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
generator client {
|
2023-04-02 09:22:50 +00:00
|
|
|
provider = "cargo prisma"
|
2023-04-02 01:30:36 +00:00
|
|
|
// The location to generate the client. Is relative to the position of the schema
|
2023-04-02 09:22:50 +00:00
|
|
|
output = "../src/db.rs"
|
|
|
|
module_path = "db"
|
|
|
|
}
|
|
|
|
|
|
|
|
model Account {
|
|
|
|
id Int @id @default(autoincrement())
|
2023-04-05 08:38:41 +00:00
|
|
|
pubkey String @unique
|
2023-04-02 09:22:50 +00:00
|
|
|
privkey String @unique
|
|
|
|
active Boolean @default(false)
|
|
|
|
metadata String
|
|
|
|
|
|
|
|
// related
|
2023-04-05 08:38:41 +00:00
|
|
|
plebs Pleb[]
|
2023-04-02 09:22:50 +00:00
|
|
|
messages Message[]
|
|
|
|
notes Note[]
|
|
|
|
|
|
|
|
@@index([pubkey])
|
|
|
|
}
|
|
|
|
|
2023-04-05 08:38:41 +00:00
|
|
|
model Pleb {
|
2023-04-02 09:22:50 +00:00
|
|
|
id Int @id @default(autoincrement())
|
2023-04-06 02:25:18 +00:00
|
|
|
plebId String @unique
|
|
|
|
pubkey String
|
2023-04-02 09:22:50 +00:00
|
|
|
kind Int
|
|
|
|
metadata String
|
|
|
|
|
|
|
|
Account Account @relation(fields: [accountId], references: [id])
|
|
|
|
accountId Int
|
|
|
|
}
|
|
|
|
|
|
|
|
model Note {
|
2023-04-05 02:20:33 +00:00
|
|
|
id Int @id @default(autoincrement())
|
|
|
|
eventId String @unique
|
2023-04-02 09:22:50 +00:00
|
|
|
pubkey String
|
|
|
|
kind Int
|
|
|
|
tags String
|
|
|
|
content String
|
|
|
|
parent_id String
|
|
|
|
parent_comment_id String
|
2023-04-05 02:20:33 +00:00
|
|
|
createdAt Int
|
2023-04-02 09:22:50 +00:00
|
|
|
|
|
|
|
Account Account @relation(fields: [accountId], references: [id])
|
|
|
|
accountId Int
|
2023-04-03 08:03:07 +00:00
|
|
|
|
2023-04-05 02:20:33 +00:00
|
|
|
@@index([eventId, createdAt])
|
2023-04-02 09:22:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
model Message {
|
2023-04-05 02:20:33 +00:00
|
|
|
id Int @id @default(autoincrement())
|
2023-04-02 09:22:50 +00:00
|
|
|
pubkey String
|
|
|
|
content String
|
|
|
|
tags String
|
2023-04-05 02:20:33 +00:00
|
|
|
createdAt Int
|
2023-04-02 09:22:50 +00:00
|
|
|
|
|
|
|
Account Account @relation(fields: [accountId], references: [id])
|
|
|
|
accountId Int
|
|
|
|
|
2023-04-05 02:20:33 +00:00
|
|
|
@@index([pubkey, createdAt])
|
2023-04-02 09:22:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
model Relay {
|
|
|
|
id Int @id @default(autoincrement())
|
|
|
|
url String
|
|
|
|
active Boolean @default(true)
|
|
|
|
}
|
|
|
|
|
|
|
|
model Setting {
|
|
|
|
id Int @id @default(autoincrement())
|
|
|
|
key String
|
|
|
|
value String
|
2023-04-02 01:30:36 +00:00
|
|
|
}
|