39 lines
818 B
TypeScript
39 lines
818 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",
|
|
},
|
|
})
|
|
|
|
await db.systemSetting.upsert({
|
|
where: { key: "public.header_banner" },
|
|
update: {},
|
|
create: {
|
|
key: "public.header_banner",
|
|
value: JSON.stringify({
|
|
enabled: true,
|
|
message: "New portfolio release is live.",
|
|
ctaLabel: "Open latest posts",
|
|
ctaHref: "/",
|
|
}),
|
|
},
|
|
})
|
|
}
|
|
|
|
main()
|
|
.catch((error) => {
|
|
console.error(error)
|
|
process.exit(1)
|
|
})
|
|
.finally(async () => {
|
|
await db.$disconnect()
|
|
})
|