sdy

add creator column

......@@ -9,26 +9,29 @@ 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("")
groups Group[] @relation(references: [id])
messages Message[]
directMessages DirectMessage[]
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("")
participatedGroup Group[] @relation("group-participants", references: [id])
createdGroup Group[] @relation("group-creator")
messages Message[]
directMessages DirectMessage[]
createdAt DateTime? @default(now())
}
model Group {
id Int @default(autoincrement()) @id
name String @unique
participants User[]
participants User[] @relation("group-participants")
messages Message[]
creator User @relation("group-creator", fields: [creatorId])
creatorId Int
files String? @default("")
createdAt DateTime? @default(now())
}
......