forked from t3dotgg/roundest-mon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.prisma
36 lines (29 loc) · 934 Bytes
/
schema.prisma
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
generator client {
provider = "prisma-client-js"
previewFeatures = ["referentialIntegrity"]
}
datasource db {
provider = "mysql"
url = env("DATABASE_URL")
shadowDatabaseUrl = env("SHADOW_URL")
referentialIntegrity = "prisma"
}
model Vote {
id String @id @default(cuid())
createdAt DateTime @default(now())
votedFor Pokemon @relation(name: "votesFor", fields: [votedForId], references: [id])
votedForId Int
votedAgainst Pokemon @relation(name: "votesAgainst", fields: [votedAgainstId], references: [id])
votedAgainstId Int
@@index([votedForId])
@@index([votedAgainstId])
}
model Pokemon {
id Int @id
name String
spriteUrl String
VoteFor Vote[] @relation("votesFor")
VoteAgainst Vote[] @relation("votesAgainst")
}