refactor: split prisma schemas

This commit is contained in:
DecDuck
2024-11-16 16:24:23 +11:00
parent 2c21a235b2
commit 9011cf5c83
6 changed files with 163 additions and 167 deletions

View File

@ -0,0 +1,28 @@
enum ClientCapabilities {
PeerAPI @map("peerAPI") // other clients can use the HTTP API to P2P with this client
UserStatus @map("userStatus") // this client can report this user's status (playing, online, etc etc)
}
// References a device
model Client {
id String @id @default(uuid())
userId String
user User @relation(fields: [userId], references: [id])
capabilities ClientCapabilities[]
name String
platform Platform
lastConnected DateTime
peerAPI ClientPeerAPIConfiguration?
}
model ClientPeerAPIConfiguration {
id String @id @default(uuid())
clientId String @unique
client Client @relation(fields: [clientId], references: [id])
endpoints String[]
}