Showing
1 changed file
with
22 additions
and
6 deletions
... | @@ -9,15 +9,31 @@ datasource db { | ... | @@ -9,15 +9,31 @@ datasource db { |
9 | 9 | ||
10 | model User { | 10 | model User { |
11 | id Int @default(autoincrement()) @id | 11 | id Int @default(autoincrement()) @id |
12 | - createdAt DateTime @default(now()) | 12 | + avatarUrl String |
13 | email String @unique | 13 | email String @unique |
14 | name String | 14 | name String |
15 | - profile Profile? | 15 | + loginSecret String |
16 | + bio String | ||
17 | + rooms Room[] @relation(references: [id]) | ||
18 | + messages Message[] | ||
19 | + createdAt DateTime @default(now()) | ||
16 | } | 20 | } |
17 | 21 | ||
18 | -model Profile { | 22 | +model Room { |
19 | id Int @default(autoincrement()) @id | 23 | id Int @default(autoincrement()) @id |
20 | - bio String | 24 | + participants User[] @relation(references: [id]) |
21 | - user User @relation(fields: [userId], references: [id]) | 25 | + categories Category[] @relation(references: [id]) |
22 | - userId Int | 26 | +} |
27 | + | ||
28 | +model Category { | ||
29 | + id Int @default(autoincrement()) @id | ||
30 | + name String | ||
31 | + rooms Room[] @relation(references: [id]) | ||
32 | +} | ||
33 | + | ||
34 | +model Message { | ||
35 | + id Int @default(autoincrement()) @id | ||
36 | + text String | ||
37 | + sender User @relation(fields: [senderId], references: [id]) | ||
38 | + senderId Int | ||
23 | } | 39 | } |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or login to post a comment