-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdatamodel.prisma
133 lines (120 loc) · 3.05 KB
/
datamodel.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
type User {
id: ID! @id
username: String! @unique
password: String!
role: Int! @default(value: 2)
active: Boolean! @default(value: true)
profile: Profile
updatedAt: DateTime! @updatedAt
createdAt: DateTime! @createdAt
}
type Profile {
id: ID! @id
oldId: ID! @unique
fullName: String!
gender: Boolean!
email: String
facebookId: String
phoneNumber: String
birthday: DateTime
joinDate: DateTime
dayOfBirth: Int
monthOfBirth: Int
yearOfBirth: Int
address: Address
hometown: Province
memberType: MemberType
group: Group @relation(link: "TABLE", name: "GroupMembers")
leader: Group @relation(link: "TABLE", name: "GroupLeader")
attendances: [ActivityAttendance] @relation(name: "ProfileAttendance")
updatedAt: DateTime! @updatedAt
createdAt: DateTime! @createdAt
}
type MemberType {
id: ID! @id
name: String! @unique
profiles: [Profile!]
updatedAt: DateTime! @updatedAt
createdAt: DateTime! @createdAt
}
type Address {
id: ID! @id
no: String
street: String
commune: Commune
district: District
province: Province
updatedAt: DateTime! @updatedAt
createdAt: DateTime! @createdAt
}
type Commune {
id: ID! @id
name: String!
district: District! @relation(name: "CommuneDistrictRef")
updatedAt: DateTime! @updatedAt
createdAt: DateTime! @createdAt
}
type District {
id: ID! @id
name: String!
communes: [Commune!] @relation(name: "CommuneDistrictRef")
province: Province! @relation(name: "DistrictProvinceRef")
updatedAt: DateTime! @updatedAt
createdAt: DateTime! @createdAt
}
type Province {
id: ID! @id
name: String!
districts: [District!] @relation(name: "DistrictProvinceRef")
updatedAt: DateTime! @updatedAt
createdAt: DateTime! @createdAt
}
type Group {
id: ID! @id
name: String!
members: [Profile] @relation(name: "GroupMembers")
leader: Profile @relation(name: "GroupLeader")
updatedAt: DateTime! @updatedAt
createdAt: DateTime! @createdAt
}
type ActivityType {
id: ID! @id
name: String!
schedules: [ActivitySchedule] @relation(name: "ActivitySchedule")
updatedAt: DateTime! @updatedAt
createdAt: DateTime! @createdAt
}
type ActivitySchedule {
id: ID! @id
start: DateTime!
end: DateTime!
activity: ActivityType! @relation(name: "ActivitySchedule")
attendances: [ActivityAttendance] @relation(name: "ScheduleAttendance")
updatedAt: DateTime! @updatedAt
createdAt: DateTime! @createdAt
}
type ActivityAttendance {
id: ID! @id
schedule: ActivitySchedule! @relation(name: "ScheduleAttendance")
member: Profile! @relation(name: "ProfileAttendance")
presence: Boolean!
updatedAt: DateTime! @updatedAt
createdAt: DateTime! @createdAt
}
type Language {
id: ID! @id
code: String! @unique
name: String!
translation: [Translation!] @relation(name: "TranslationLanguage")
}
type Translation {
id: ID! @id
text: String!
language: Language @relation(link: TABLE, name: "TranslationLanguage")
localization: Localization @relation(link: TABLE, name: "TranslationLocalization")
}
type Localization {
id: ID! @id
key: String! @unique
translations: [Translation!] @relation(name: "TranslationLocalization")
}