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
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
28 deletions
back/prisma/schema.prisma
back/prisma/schema.prisma
View file @
17ac4ee
...
...
@@ -9,44 +9,47 @@ datasource db {
}
model User {
id Int @default(autoincrement()) @id
avatarUrl String? @default("")
email String @unique
password String
username String
phoneNum String @default("") @unique
emailSecret String? @default("")
phoneSecret String? @default("")
bio String? @default("")
rooms Room[] @relation(references: [id])
sendMessage Message[] @relation("Sender")
receiveMessage Message[] @relation("Receiver")
createdAt DateTime? @default(now())
id Int @default(autoincrement()) @id
avatarUrl String? @default("")
email String @unique
password String
username String
phoneNum String @default("") @unique
emailSecret String? @default("")
phoneSecret String? @default("")
bio String? @default("")
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])
id Int @default(autoincrement()) @id
name String? @default("")
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: [from
Id], references: [id])
fromId
Int
to User? @relation("Receiver", fields: [to
Id], references: [id])
toId Int?
room Room @relation(fields: [roomId], references: [id]
)
roomId Int
c
reatedAt DateTime? @default(now())
id
Int @default(autoincrement()) @id
text
String
@default("")
sender User @relation(fields: [sender
Id], references: [id])
senderId
Int
room Room @relation(fields: [room
Id], references: [id])
roomId Int
createdAt DateTime? @default(now()
)
category Category? @relation(fields: [categoryId], references: [id])
c
ategoryId Int?
}
\ No newline at end of file
...
...
Please
register
or
login
to post a comment