25 lines
487 B
TypeScript
25 lines
487 B
TypeScript
import { db } from "../src/client"
|
|
|
|
async function main() {
|
|
await db.post.upsert({
|
|
where: { slug: "welcome" },
|
|
update: {},
|
|
create: {
|
|
title: "Welcome to your CMS",
|
|
slug: "welcome",
|
|
excerpt: "Your first seeded post",
|
|
body: "Edit or delete this post from your admin area.",
|
|
status: "published",
|
|
},
|
|
})
|
|
}
|
|
|
|
main()
|
|
.catch((error) => {
|
|
console.error(error)
|
|
process.exit(1)
|
|
})
|
|
.finally(async () => {
|
|
await db.$disconnect()
|
|
})
|