mirror of
https://github.com/hknsh/project-knedita.git
synced 2024-11-28 17:41:15 +00:00
28 lines
566 B
JavaScript
28 lines
566 B
JavaScript
import { PrismaClient } from '@prisma/client'
|
|
|
|
const prisma = new PrismaClient()
|
|
|
|
async function main () {
|
|
await prisma.user.deleteMany({
|
|
where: {
|
|
username: 'cookie_'
|
|
}
|
|
})
|
|
|
|
console.log('Seeding database...')
|
|
|
|
await prisma.user.create({
|
|
data: {
|
|
displayName: 'Cookie_',
|
|
username: 'cookie_',
|
|
email: 'cookie@cookie.com',
|
|
password: '$2a$10$vBx5LkpZNMC3j1bHopUcp.ZcsMt5xfWlUJJGYIb4511aNccnHmMqi' // cookie
|
|
}
|
|
})
|
|
}
|
|
|
|
main()
|
|
.catch((e) => console.error(e))
|
|
.finally(async () => {
|
|
await prisma.$disconnect()
|
|
})
|