sdy

change schema

generator client {
provider = "prisma-client-js"
provider = "prisma-client-js"
binaryTargets = ["native", "debian-openssl-1.1.x"]
}
datasource db {
......@@ -9,14 +10,15 @@ datasource db {
model User {
id Int @default(autoincrement()) @id
avatarUrl String
avatarUrl String?
email String @unique
password String
name String
loginSecret String
bio String
loginSecret String?
bio String?
rooms Room[] @relation(references: [id])
messages Message[]
createdAt DateTime @default(now())
createdAt DateTime? @default(now())
}
model Room {
......@@ -26,14 +28,14 @@ model Room {
}
model Category {
id Int @default(autoincrement()) @id
name String
rooms Room[] @relation(references: [id])
id Int @default(autoincrement()) @id
name String? @default("")
rooms Room[] @relation(references: [id])
}
model Message {
id Int @default(autoincrement()) @id
text String
sender User @relation(fields: [senderId], references: [id])
id Int @default(autoincrement()) @id
text String? @default("")
sender User @relation(fields: [senderId], references: [id])
senderId Int
}
\ No newline at end of file
......