Hello I'm upgrading from prisma1 and I'm trying to...
# orm-help
p
Hello I'm upgrading from prisma1 and I'm trying to get this relation to the new prisma4. Any ideias how this is now defined ? From prisma1: adultVersion: GarmentType @relation(name: "GarmentTypeAdultChild") childVersion: GarmentType @relation(name: "GarmentTypeAdultChild", link: TABLE)
1
m
are you trying to referene the same type of node as the model itself?
Copy code
model OrganizationalUnit {
...
organizationalUnitOfGuid String?                                @db.Uuid
  organizationalUnitOf     OrganizationalUnit?                    @relation(name: "UnitHiearchy", fields: [organizationalUnitOfGuid], references: [guid])
  organizationalUnits      OrganizationalUnit[]                   @relation(name: "UnitHiearchy")
}
n
Hey Pedro 👋 Did you try introspect your database to get your models automatically declared in your schema file?