feat: dockerfile + docker-compose + déploiement VPS gestion.materiaux-destock.fr
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import { PrismaClient } from '@prisma/client'
|
||||
import { hash } from 'bcryptjs'
|
||||
|
||||
const prisma = new PrismaClient()
|
||||
|
||||
const password = process.env.SEED_ADMIN_PASSWORD
|
||||
if (!password) {
|
||||
console.error('SEED_ADMIN_PASSWORD requis')
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
await prisma.user.upsert({
|
||||
where: { email: 'mathieu.fort@gmail.com' },
|
||||
update: {},
|
||||
create: {
|
||||
email: 'mathieu.fort@gmail.com',
|
||||
name: 'Mathieu',
|
||||
password: await hash(password, 12),
|
||||
role: 'admin',
|
||||
},
|
||||
})
|
||||
console.log('✅ Compte admin créé : mathieu.fort@gmail.com')
|
||||
await prisma.$disconnect()
|
||||
Reference in New Issue
Block a user