Lars-Jørgen Kristiansen
09/08/2020, 9:23 AMUNIQUE
constraints"
It seems like some of the contraints it wants me to add are "switched"
This is the problamatic datamodel
type Absent {
treatment: AbsentTreatment!
@relation(link: INLINE, name: "TreatmentOnAbsent", onDelete: CASCADE)
}
type AbsentTreatment {
absent: Absent! @relation(name: "TreatmentOnAbsent", onDelete: SET_NULL)
}
It wants me to run:
ALTER TABLE "default$default"."AbsentTreatment" ADD UNIQUE ("absent");
But there is no absent field on AbsentTreatment with this model.. Should I instead run the following?
ALTER TABLE "default$default"."Absent" ADD UNIQUE ("treatment");
Or should i update the prisma1 datamodel?Lars-Jørgen Kristiansen
09/08/2020, 10:29 AMnikolasburk
treatment
column on TreatmentOnAbsent
should indeed receive UNIQUE
constraint as you suggest! Thanks a lot for creating the issue, we'll look into it as soon possible! 🙏