dotEXE
dotEXE
Explore posts from servers
PPrisma
Created by dotEXE on 3/17/2025 in #help-and-questions
Remove the "?" in "user?.post"
No description
5 replies
PPrisma
Created by dotEXE on 3/16/2025 in #help-and-questions
@map("updated_at") still shows updatedAt in prisma studio
Hey, So I did
updatedAt DateTime @updatedAt @map("updated_at")
updatedAt DateTime @updatedAt @map("updated_at")
But when I go and do npx prisma studio, I still see it there as updatedAt, why?
4 replies
PPrisma
Created by dotEXE on 3/16/2025 in #help-and-questions
How to update Prisma @unique
Hello, So I started a new NextJS project. I did this:
model Post {
id String @id @default(cuid())
title String
slug String
content String
updatedAt DateTime @updatedAt
createdAt DateTime @default(now())
}
model Post {
id String @id @default(cuid())
title String
slug String
content String
updatedAt DateTime @updatedAt
createdAt DateTime @default(now())
}
Then I added to slug @unique But when I tried to do
const post = await prisma.post.findUnique({
where: {
slug
}
});
const post = await prisma.post.findUnique({
where: {
slug
}
});
It gave me an error : Invalid prisma.user.findUnique() invocation: How do I apply the new @unique? the npx prisma db push did not work
13 replies