Hi! Trying to upgrade from prisma1 to prisma2 and ...
# orm-help
l
Hi! Trying to upgrade from prisma1 to prisma2 and got stuck on the step where it wants me to "Fix 1-1 relations by adding
UNIQUE
constraints" It seems like some of the contraints it wants me to add are "switched" This is the problamatic datamodel
Copy code
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?
🙏 1
n
Hey Lars-Jørgen 👋 sorry for the delay and thanks for raising this! Yeah this looks like indeed like a bug in the Upgrade CLI, I assume that the
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! 🙏