Noah
Noah
Explore posts from servers
PPrisma
Created by Noah on 9/19/2024 in #help-and-questions
Using the same GraphEntry model for different graphs
I've got two models and am trying to have two different graphs using the same GraphEntry model with a different graph type. Any way to do this?
model House {
id Int @id @default(autoincrement())

internal_id String @unique

// ...

// Graphing
graph_first GraphEntry[]
graph_second GraphEntry[]
}

model GraphEntry {
entry_id String @id @default(cuid())
parent_internal_id String

time_created DateTime @default(now())
value Int

graph_type GraphType

house House @relation(fields: [parent_internal_id], references: [internal_id])
}

enum GraphType {
FirstGraph
SecondGraph
}
model House {
id Int @id @default(autoincrement())

internal_id String @unique

// ...

// Graphing
graph_first GraphEntry[]
graph_second GraphEntry[]
}

model GraphEntry {
entry_id String @id @default(cuid())
parent_internal_id String

time_created DateTime @default(now())
value Int

graph_type GraphType

house House @relation(fields: [parent_internal_id], references: [internal_id])
}

enum GraphType {
FirstGraph
SecondGraph
}
1 replies
DIAdiscord.js - Imagine an app
Created by Noah on 9/1/2023 in #djs-questions
TS + D.JS Error - unable to get the options
11 replies
DIAdiscord.js - Imagine an app
Created by Noah on 10/11/2022 in #djs-questions
Using djs without making a bot?
Cant find any useful resources for this, i'm making an API and need to get some stuff from Discord but discord js is literally the only thing that pops up when i google for something like that, any way to do this?
3 replies