prisma sqllite 초기화

This commit is contained in:
koreacomp5
2025-10-08 23:04:12 +09:00
parent f0640478da
commit 3c0e242603
10 changed files with 522 additions and 8 deletions

28
prisma/seed.js Normal file
View File

@@ -0,0 +1,28 @@
const { PrismaClient } = require("@prisma/client");
const prisma = new PrismaClient();
async function main() {
await prisma.user.upsert({
where: { email: "test@example.com" },
update: {},
create: {
email: "test@example.com",
name: "Tester",
messages: {
create: [{ content: "Hello world" }, { content: "Second message" }]
}
}
});
}
main()
.catch((e) => {
console.error(e);
process.exit(1);
})
.finally(async () => {
await prisma.$disconnect();
});