-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathschema.prisma
88 lines (78 loc) · 1.53 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
url = "postgresql://postgres:prisma@localhost:5435/dev"
}
enum TeamType {
CLUB
NATIONAL
}
model Team {
id Int @id @default(autoincrement())
name String
key String @unique
type TeamType
website String
motto String?
description String?
stadium Stadium? @relation(fields: [stadiumId], references: [id])
stadiumId Int?
squad Squad[]
}
enum SquadType {
SENIOR_MEN
SENIOR_WOMEN
ACADEMY
}
model Squad {
id Int @id @default(autoincrement())
team Team @relation(fields: [teamId], references: [id])
teamId Int
type SquadType
players Player[]
}
enum PlayerPosition {
GK
LB
CB
RB
DM
CM
AM
LW
RW
ST
}
model Player {
id Int @id @default(autoincrement())
name String
nickname String?
dob DateTime
key String @unique
position PlayerPosition
squad Squad? @relation(fields: [squadId], references: [id])
squadId Int?
}
model Stadium {
id Int @id @default(autoincrement())
name String
key String @unique
capacity Int
pitch Pitch?
team Team[]
}
enum PitchType {
GRASS
HYBRID
ARTIFICIAL
}
model Pitch {
id Int @id @default(autoincrement())
stadium Stadium @relation(fields: [stadiumId], references: [id])
stadiumId Int @unique
surfaceType PitchType
width Float
length Float
}