Yaniv Efraim
09/12/2022, 3:56 PMmodel tagged_artifact_assets {
artifact_id String @db.VarChar(128)
tag String @db.VarChar(32)
app_def_id String @db.VarChar(32)
config_id String @db.VarChar(32)
config configs? //This is a relation to configs table
@@id([artifact_id, tag])
@@unique([artifact_id, tag])
}
model configs {
config_id String @id @db.VarChar(32)
value Json
artifacts tagged_artifact_assets @relation(fields: [artifact_id, tag], references: [artifact_id, tag])
artifact_id String @db.VarChar(32)
tag String @db.VarChar(32)
@@unique([artifact_id, tag])
}
The relation is tagged_artifact_assets
-> configs
.
When trying to create
, I get:
The column `artifact_id` does not exist in the current database.GrpcStatusError: UNKNOWN:
Invalid `prisma.configs.create()` invocation:
I guess that this is because I do not have a foreign key named artifact_id
in `configs`…
So,
• Is it possible to have 1to1 relation with no foreign key?
• If not, how can I use join
for select
statment?
Thanks, and sorry for the long post 🙏Vladi Stevanovic
Harshit
09/16/2022, 3:21 PMVladi Stevanovic