Showing
1 changed file
with
43 additions
and
0 deletions
1 | +generator client { | ||
2 | + provider = "prisma-client-js" | ||
3 | + binaryTargets = ["native", "debian-openssl-1.1.x"] | ||
4 | +} | ||
5 | + | ||
6 | +datasource db { | ||
7 | + provider = "mysql" | ||
8 | + url = "***" | ||
9 | +} | ||
10 | + | ||
11 | +model User { | ||
12 | + id Int @default(autoincrement()) @id | ||
13 | + avatarUrl String? | ||
14 | + email String @unique | ||
15 | + password String | ||
16 | + name String | ||
17 | + phoneNumber Int? | ||
18 | + emailSecret String? | ||
19 | + phoneSecret String? | ||
20 | + bio String? | ||
21 | + rooms Room[] @relation(references: [id]) | ||
22 | + messages Message[] | ||
23 | + createdAt DateTime? @default(now()) | ||
24 | +} | ||
25 | + | ||
26 | +model Room { | ||
27 | + id Int @default(autoincrement()) @id | ||
28 | + participants User[] @relation(references: [id]) | ||
29 | + categories Category[] @relation(references: [id]) | ||
30 | +} | ||
31 | + | ||
32 | +model Category { | ||
33 | + id Int @default(autoincrement()) @id | ||
34 | + name String? @default("") | ||
35 | + rooms Room[] @relation(references: [id]) | ||
36 | +} | ||
37 | + | ||
38 | +model Message { | ||
39 | + id Int @default(autoincrement()) @id | ||
40 | + text String? @default("") | ||
41 | + sender User @relation(fields: [senderId], references: [id]) | ||
42 | + senderId Int | ||
43 | +} | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
-
Please register or login to post a comment