23 lines
540 B
TypeScript
23 lines
540 B
TypeScript
import { PrismaClient } from '@prisma/client'
|
|
|
|
const prisma = new PrismaClient()
|
|
|
|
async function main() {
|
|
const user = await prisma.user.upsert({
|
|
where: { email: 'test@test.com' },
|
|
update: {},
|
|
create: {
|
|
email: 'test@test.com',
|
|
name: 'Test User',
|
|
password: `testing1234`
|
|
}
|
|
})
|
|
console.log({ user })
|
|
}
|
|
main()
|
|
.then(() => prisma.$disconnect())
|
|
.catch(async (e) => {
|
|
console.error(e)
|
|
await prisma.$disconnect()
|
|
process.exit(1)
|
|
}) |