79 lines
1.6 KiB
Plaintext
79 lines
1.6 KiB
Plaintext
datasource db {
|
|
provider = "sqlite"
|
|
url = "file:../../lume.db"
|
|
}
|
|
|
|
generator client {
|
|
provider = "cargo prisma"
|
|
// The location to generate the client. Is relative to the position of the schema
|
|
output = "../src/db.rs"
|
|
module_path = "db"
|
|
}
|
|
|
|
model Account {
|
|
id Int @id @default(autoincrement())
|
|
pubkey String
|
|
privkey String @unique
|
|
active Boolean @default(false)
|
|
metadata String
|
|
|
|
// related
|
|
follows Follow[]
|
|
messages Message[]
|
|
notes Note[]
|
|
|
|
@@index([pubkey])
|
|
}
|
|
|
|
model Follow {
|
|
id Int @id @default(autoincrement())
|
|
pubkey String
|
|
kind Int
|
|
metadata String
|
|
|
|
Account Account @relation(fields: [accountId], references: [id])
|
|
accountId Int
|
|
}
|
|
|
|
model Note {
|
|
id Int @id @default(autoincrement())
|
|
eventId String @unique
|
|
pubkey String
|
|
kind Int
|
|
tags String
|
|
content String
|
|
parent_id String
|
|
parent_comment_id String
|
|
createdAt Int
|
|
|
|
Account Account @relation(fields: [accountId], references: [id])
|
|
accountId Int
|
|
|
|
@@index([eventId, createdAt])
|
|
}
|
|
|
|
model Message {
|
|
id Int @id @default(autoincrement())
|
|
pubkey String
|
|
content String
|
|
tags String
|
|
createdAt Int
|
|
|
|
Account Account @relation(fields: [accountId], references: [id])
|
|
accountId Int
|
|
|
|
@@index([pubkey, createdAt])
|
|
}
|
|
|
|
model Relay {
|
|
id Int @id @default(autoincrement())
|
|
url String
|
|
active Boolean @default(true)
|
|
}
|
|
|
|
model Setting {
|
|
id Int @id @default(autoincrement())
|
|
key String
|
|
value String
|
|
}
|