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-08-30 22:59:02 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
b48a05ab17926061a02322f045efc730a0d3a23c
b48a05ab
1 parent
ef98fd71
update schema.prisma
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
15 deletions
back/prisma/schema.prisma
back/prisma/schema.prisma
View file @
b48a05a
...
...
@@ -18,27 +18,27 @@ model User {
emailSecret String? @default("")
phoneSecret String? @default("")
bio String? @default("")
rooms Room[]
@relation(references: [id])
groups Group[]
@relation(references: [id])
messages Message[]
sender User[] @relation("SenderReceiver", references: [id])
receiver User[] @relation("SenderReceiver", references: [id])
directMessages DirectMessage[]
createdAt DateTime? @default(now())
}
model
Room
{
model
Group
{
id Int @default(autoincrement()) @id
name String @unique
participants User[] @relation(references: [id])
categories Category[]
participants User[]
messages Message[]
files String? @default("")
createdAt DateTime? @default(now())
}
model
Category
{
model
DirectMessage
{
id Int @default(autoincrement()) @id
name String @default("") @unique
room Room @relation(fields: [room
Id], references: [id])
roomId
Int
messages Message[]
text String @default("")
sender User @relation(fields: [sender
Id], references: [id])
senderId
Int
createdAt DateTime? @default(now())
}
model Message {
...
...
@@ -46,9 +46,7 @@ model Message {
text String @default("")
sender User @relation(fields: [senderId], references: [id])
senderId Int
room Room @relation(fields: [room
Id], references: [id])
roomId
Int
group Group @relation(fields: [group
Id], references: [id])
groupId
Int
createdAt DateTime? @default(now())
category Category? @relation(fields: [categoryId], references: [id])
categoryId Int?
}
...
...
Please
register
or
login
to post a comment