Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2020-1-capstone-design1
/
Triz_Project1
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
1
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
sdy
2020-05-20 13:57:23 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
17ac4ee775c114528d890877586d12fd59b1fc85
17ac4ee7
1 parent
4bd86a9b
update DB schema
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
12 deletions
back/prisma/schema.prisma
back/prisma/schema.prisma
View file @
17ac4ee
...
...
@@ -18,35 +18,38 @@ model User {
emailSecret String? @default("")
phoneSecret String? @default("")
bio String? @default("")
rooms Room[] @relation(references: [id])
sendMessage Message[] @relation("Sender")
receiveMessage Message[] @relation("Receiver")
room Room @relation(fields: [roomId], references: [id])
roomId Int
messages Message[]
sender User @relation("SenderReceiver", fields: [id], references: [id])
receiver User? @relation("SenderReceiver")
createdAt DateTime? @default(now())
}
model Room {
id Int @default(autoincrement()) @id
name String
participants User[]
@relation(references: [id])
participants User[]
categories Category[]
Message
Message[]
messages
Message[]
}
model Category {
id Int @default(autoincrement()) @id
name String? @default("")
SubRoom Int
room Room @relation(fields: [SubRoom], references: [id])
room Room @relation(fields: [roomId], references: [id])
roomId Int
messages Message[]
}
model Message {
id Int @default(autoincrement()) @id
text String? @default("")
from User @relation("Sender", fields: [fromId], references: [id])
fromId Int
to User? @relation("Receiver", fields: [toId], references: [id])
toId Int?
text String @default("")
sender User @relation(fields: [senderId], references: [id])
senderId Int
room Room @relation(fields: [roomId], references: [id])
roomId Int
createdAt DateTime? @default(now())
category Category? @relation(fields: [categoryId], references: [id])
categoryId Int?
}
\ No newline at end of file
...
...
Please
register
or
login
to post a comment