add fk migration

This commit is contained in:
Kalle (Sendou)
2021-01-29 10:16:00 +02:00
parent d2c0845946
commit 19be942e78
2 changed files with 4 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
-- AddForeignKey
ALTER TABLE "DetailedMap" ADD FOREIGN KEY ("ladderMatchId") REFERENCES "LadderMatch"("id") ON DELETE SET NULL ON UPDATE CASCADE;

View File

@@ -292,6 +292,7 @@ model LadderMatch {
dayId Int
players LadderMatchPlayer[]
day LadderDay @relation(fields: [dayId], references: [id])
details DetailedMap[]
}
model LadderDay {
@@ -311,6 +312,7 @@ model DetailedMap {
date DateTime?
ladderMatchId Int?
players DetailedMapPlayer[]
ladderMatch LadderMatch? @relation(fields: [ladderMatchId], references: [id])
}
enum WinnerLoser {