'Back-end/Prisma' 카테고리의 글 목록
PureMax77 Dev Note
Back-end/Prisma
[Prisma2] Cascade(onDelete), Set Null 구현
2021.05.19
1. Casecade, Set Null 이해 model Photo { ... // 주요 내용만 보기 쉽게 나머지 요소들 생략(...은 실제 코드가 아님) hashtags Hashtag[] likes Like[] Comment Comment[] } model Hashtag { ... photos Photo[] } model Like { ... photo Photo @relation(fields: [photoId], references: [id]) photoId Int } model Comment { ... photo Photo @relation(fields: [photoId], references: [id]) photoId Int } 위 코드는 프리즈마 데이터 모델 중 사진(Photo), 해시태그(Hash..