You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using text type store rich text in db,This is the exist prisma.schema in another project(Article.body is the column to store rich text)
model Category {
id Int @id @default(autoincrement())
title String
articles Article[]
}
model Article {
id Int @id @default(autoincrement())
category Category @relation(fields: [categoryId], references: [id])
categoryId Int
createdAt DateTime @default(now())
updatedAt DateTime @default(now())
isDeleted Boolean @default(false)
orgLink String @default("")
thumbnail String
title String
body String @db.Text
overview String @default("")
}
And this is generate by prisma.ts in keystone
model Category {
id Int @id @default(autoincrement())
title String @default("")
articles Article[] @relation("Article_category")
}
model Article {
id Int @id @default(autoincrement())
category Category? @relation("Article_category", fields: [categoryId], references: [id])
categoryId Int? @map("category")
createdAt DateTime?@default(now())
updatedAt DateTime?@default(now())
isDeleted Boolean @default(false)
orgLink String @default("")
thumbnail String @default("")
title String @default("")
body Json @default("[{\"type\":\"paragraph\",\"children\":[{\"text\":\"\"}]}]")
overview String @default("")
@@index([categoryId])
}
Current I create a custom field like this(read the code and keystone 5 's doc) to solve it, But it has a bug rich text body is empty when creating it only work when updating
I am using text type store rich text in db,This is the exist
prisma.schema
in another project(Article.body is the column to store rich text)And this is generate by
prisma.ts
in keystoneand the schema.ts
The text was updated successfully, but these errors were encountered: