-
Notifications
You must be signed in to change notification settings - Fork 28
/
datamodel.prisma
112 lines (98 loc) · 2.32 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
generator client {
provider = "prisma-client-js"
output = "../.prisma"
}
generator typegraphql {
provider = "typegraphql-prisma"
}
datasource db {
provider = "postgresql"
url = env("POSTGRESQL_URL")
}
model UserRole {
id String @id @default(uuid())
name String
users User[]
}
model Company {
id String @id @default(uuid())
name String
user User @relation(fields: [userId], references: [id])
userId String
}
model UserSocialMedia {
id String @id @default(uuid())
instagram String
twitter String
user User @relation(fields: [userId], references: [id])
userId String @unique
}
model BlogPost {
id String @id @default(uuid())
title String
text String
author User? @relation(fields: [authorId], references: [id])
authorId String?
comments BlogPostComment[]
}
model BlogPostComment {
id String @id @default(uuid())
text String
post BlogPost? @relation(fields: [postId], references: [id])
postId String?
author User? @relation(fields: [authorId], references: [id])
authorId String?
}
model Site {
id String @id @default(uuid())
name String
url String
owner User? @relation(fields: [userId], references: [id])
userId String? @unique
}
enum Gender {
MALE
FEMALE
OTHER
}
model User {
id String @id @default(uuid())
email String @unique
roles UserRole[]
firstName String?
lastName String?
gender Gender?
yearOfBirth Int?
wantsNewsletter Boolean
interests Topic[]
userSocialMedia UserSocialMedia?
/// @TypeGraphQL.omit(output: true)
address Json?
blogPosts BlogPost[]
comments BlogPostComment[]
companies Company[]
weddingDate DateTime?
/// @TypeGraphQL.omit(output: true)
site Site?
}
model FilteringTest {
id Int @id @default(autoincrement())
intField Int
floatField Float
stringField String
dateTimeField DateTime
boolField Boolean
intField_lt String
intField_bt Int
snake_field Int
snake_field_bt Int
}
model SomePublicRecordWithIntId {
id Int @id @default(autoincrement())
title String
}
enum Topic {
TOPIC_ONE
TOPIC_TWO
TOPIC_THREE
}