23 lines
387 B
TypeScript
23 lines
387 B
TypeScript
|
|
import { prisma } from '../src/lib/prisma'
|
||
|
|
|
||
|
|
async function main() {
|
||
|
|
console.log('first')
|
||
|
|
|
||
|
|
await prisma.role.upsert({
|
||
|
|
where: { id: 0, name: 'Admin' },
|
||
|
|
update: {},
|
||
|
|
create: {
|
||
|
|
name: 'Admin',
|
||
|
|
},
|
||
|
|
})
|
||
|
|
}
|
||
|
|
main()
|
||
|
|
.then(async () => {
|
||
|
|
await prisma.$disconnect()
|
||
|
|
})
|
||
|
|
.catch(async e => {
|
||
|
|
console.error(e)
|
||
|
|
await prisma.$disconnect()
|
||
|
|
process.exit(1)
|
||
|
|
})
|