Files
qrcode-inventory/prisma/seed.ts
2025-08-05 09:20:41 -04:00

26 lines
492 B
TypeScript

import { PrismaClient } from '@prisma/client'
import { hash } from 'bcryptjs'
const prisma = new PrismaClient()
async function main() {
const password = await hash('password', 10)
const user = await prisma.user.create({
data: {
email: 'test@example.com',
password,
},
})
console.log({ user })
}
main()
.then(async () => {
await prisma.$disconnect()
})
.catch(async (e) => {
console.error(e)
await prisma.$disconnect()
process.exit(1)
})