Initial commit
This commit is contained in:
24
packages/db/prisma/seed.ts
Normal file
24
packages/db/prisma/seed.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
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()
|
||||
})
|
||||
Reference in New Issue
Block a user