mznotes/prisma/schema.prisma

89 lines
1.6 KiB
Text
Raw Normal View History

2023-03-23 18:32:34 +00:00
generator client {
provider = "prisma-client-js"
binaryTargets = ["native"]
}
datasource db {
provider = "sqlite"
url = env("DATABASE_URL")
}
model Node {
id String @id @default(uuid())
label String?
implements NodeImplements[]
fromNodes Graph[] @relation(name: "fromNode")
toNodes Graph[] @relation(name: "toNode")
2023-03-30 01:56:52 +00:00
metadata NodeMeta[]
2023-03-23 18:32:34 +00:00
}
model Edge {
id String @id @default(uuid())
}
model Interface {
id String @id @default(uuid())
implementors NodeImplements[]
}
model Graph {
label String?
fromId String
fromNode Node @relation(name: "fromNode", fields: [fromId], references: [id])
toId String
toNode Node @relation(name: "toNode", fields: [toId], references: [id])
@@id([fromId, toId])
}
2023-03-30 01:56:52 +00:00
model NodeMeta {
nodeId String
toNode Node @relation(fields: [nodeId], references: [id])
appId String
app App @relation(fields: [appId], references: [id])
key String
value Bytes
@@id([nodeId, appId, key])
}
2023-03-23 18:32:34 +00:00
model NodeImplements {
nodeId String
node Node @relation(fields: [nodeId], references: [id])
interfaceId String
interface Interface @relation(fields: [interfaceId], references: [id])
@@id([nodeId, interfaceId])
}
2023-03-30 01:56:52 +00:00
model App {
id String @id @default(uuid())
localName String @unique
title String
installed DateTime
patterns Patterns[]
metaKeys NodeMeta[]
}
/// Regular expressions table
model Patterns {
id String @id @default(uuid())
pattern String
appId String
app App @relation(fields: [appId], references: [id])
functionName String
}