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
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
34 deletions
back/prisma/schema.prisma
back/prisma/schema.prisma
View file @
b48a05a
...
...
@@ -9,46 +9,44 @@ datasource db {
}
model User {
id Int @default(autoincrement()) @id
avatarUrl String? @default("")
username String
email String @unique
password String
phoneNum String @default("") @unique
emailSecret String? @default("")
phoneSecret String? @default("")
bio String? @default("")
rooms Room[] @relation(references: [id])
messages Message[]
sender User[] @relation("SenderReceiver", references: [id])
receiver User[] @relation("SenderReceiver", references: [id])
createdAt DateTime? @default(now())
id Int @default(autoincrement()) @id
avatarUrl String? @default("")
username String
email String @unique
password String
phoneNum String @default("") @unique
emailSecret String? @default("")
phoneSecret String? @default("")
bio String? @default("")
groups Group[] @relation(references: [id])
messages Message[]
directMessages DirectMessage[]
createdAt DateTime? @default(now())
}
model Room {
id Int @default(autoincrement()) @id
name String @unique
participants User[] @relation(references: [id])
categories Category[]
model Group {
id Int @default(autoincrement()) @id
name String @unique
participants User[]
messages Message[]
files String? @default("")
createdAt DateTime? @default(now())
}
model
Category
{
id Int @default(autoincrement()) @id
name String @default("") @unique
room Room @relation(fields: [room
Id], references: [id])
roomId
Int
messages Message[]
model
DirectMessage
{
id
Int @default(autoincrement()) @id
text String @default("")
sender User @relation(fields: [sender
Id], references: [id])
senderId
Int
createdAt DateTime? @default(now())
}
model Message {
id Int @default(autoincrement()) @id
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?
id Int @default(autoincrement()) @id
text String @default("")
sender User @relation(fields: [senderId], references: [id])
senderId Int
group Group @relation(fields: [groupId], references: [id])
groupId Int
createdAt DateTime? @default(now())
}
...
...
Please
register
or
login
to post a comment