Skip to content

Commit 7c063fa

Browse files
authored
Cascade Interest on InterestSubject Deletion (#573)
# PRの概要 ## 具体的な変更内容 ## 影響範囲 ## 動作要件 ## 補足 ## レビューリクエストを出す前にチェック! - [ ] 改めてセルフレビューしたか - [ ] 手動での動作検証を行ったか - [ ] server の機能追加ならば、テストを書いたか - 理由: 書いた | server の機能追加ではない - [ ] 間違った使い方が存在するならば、それのドキュメントをコメントで書いたか - 理由: 書いた | 間違った使い方は存在しない - [ ] わかりやすいPRになっているか <!-- レビューリクエスト後は、Slackでもメンションしてお願いすることを推奨します。 -->
1 parent 64f2a0c commit 7c063fa

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

server/prisma/schema.prisma

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ model Avatar {
4848
}
4949

5050
model Picture {
51-
hash String @id
52-
data Bytes
53-
key String // password
51+
hash String @id
52+
data Bytes
53+
key String // password
5454
}
5555

5656
model InterestSubject {
@@ -67,7 +67,7 @@ model Interest {
6767
userId Int
6868
user User @relation(fields: [userId], references: [id])
6969
subjectId Int
70-
subject InterestSubject @relation(fields: [subjectId], references: [id])
70+
subject InterestSubject @relation(fields: [subjectId], references: [id], onDelete: Cascade)
7171
7272
@@unique([userId, subjectId])
7373
}
@@ -137,11 +137,11 @@ model SharedRoom {
137137

138138
model Message {
139139
id Int @id @default(autoincrement())
140-
creator Int // refers to UserId
140+
creator Int // refers to UserId
141141
createdAt DateTime @default(now()) // @readonly
142142
edited Boolean @default(false)
143143
content String
144-
isPicture Boolean // iff the message is a picture. if true, then content is a url of picture.
144+
isPicture Boolean // iff the message is a picture. if true, then content is a url of picture.
145145
read Boolean @default(false)
146146
relation Relationship? @relation(fields: [relationId], references: [id], onDelete: Cascade)
147147
relationId Int?

0 commit comments

Comments
 (0)