subman-nextjs/prisma/script.js

25 lines
545 B
JavaScript
Raw Permalink Normal View History

2024-09-30 14:06:52 +00:00
import { PrismaClient } from "@prisma/client";
2024-06-11 13:35:56 +00:00
2024-09-30 14:06:52 +00:00
const prisma = new PrismaClient();
2024-06-11 13:35:56 +00:00
async function main() {
2024-09-30 14:06:52 +00:00
// ... you will write your Prisma Client queries here
const story = await prisma.story.update({
where: { id: 1 },
data: {
title: "Ghost Aliens of Mars",
genres: { set: [{ id: 1 }, { id: 2 }], create: { name: "alien-punk" } },
},
});
2024-06-11 13:35:56 +00:00
}
main()
2024-09-30 14:06:52 +00:00
.then(async () => {
await prisma.$disconnect();
})
.catch(async (e) => {
console.error(e);
await prisma.$disconnect();
process.exit(1);
});