sdy

update prisma schema

......@@ -8,16 +8,32 @@ datasource db {
}
model User {
id Int @default(autoincrement()) @id
createdAt DateTime @default(now())
email String @unique
name String
profile Profile?
id Int @default(autoincrement()) @id
avatarUrl String
email String @unique
name String
loginSecret String
bio String
rooms Room[] @relation(references: [id])
messages Message[]
createdAt DateTime @default(now())
}
model Profile {
id Int @default(autoincrement()) @id
bio String
user User @relation(fields: [userId], references: [id])
userId Int
model Room {
id Int @default(autoincrement()) @id
participants User[] @relation(references: [id])
categories Category[] @relation(references: [id])
}
model Category {
id Int @default(autoincrement()) @id
name String
rooms Room[] @relation(references: [id])
}
model Message {
id Int @default(autoincrement()) @id
text String
sender User @relation(fields: [senderId], references: [id])
senderId Int
}
\ No newline at end of file
......