Files
lume/src-tauri/prisma/schema.prisma
2023-04-03 15:03:07 +07:00

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 DateTime @default(now())
Account Account @relation(fields: [accountId], references: [id])
accountId Int
@@index([eventId])
}
model Message {
id Int @id @default(autoincrement())
pubkey String
content String
tags String
createdAt DateTime @default(now())
Account Account @relation(fields: [accountId], references: [id])
accountId Int
@@index([pubkey])
}
model Relay {
id Int @id @default(autoincrement())
url String
active Boolean @default(true)
}
model Setting {
id Int @id @default(autoincrement())
key String
value String
}