Hi everyone, I was trying to remove a delete casca...
# orm-help
l
Hi everyone, I was trying to remove a delete cascade from a many to many relation implicit, when I delete a tag that is present on a card it also deletes the card.
Copy code
model card {
  id              Int           @id @default(autoincrement())
  name            String?       @db.VarChar(100)
  position        Int?

  tags tags[] @relation("card_tags")
}

model tags {
  id            Int             @id @default(autoincrement())
  name          String?         @db.VarChar(100)
  color         String?         @db.VarChar(100)
  
  cards   card[] @relation("card_tags")
}
When I try to restrict the onDelete action it shows this error
Copy code
tags tags[] @relation("card_tags", onDelete: Restrict) // ''Error validating: Referential actions on implicit many-to-many relations are not supported''
Any tip to proceed with this situation? Thanks!!
n
Hey 👋 You would need to define an explicit many-to-many relation and define your referential actions on the join table