mirror of
https://github.com/BreizhHardware/Site-comptage-heure.git
synced 2026-01-18 16:17:28 +01:00
feat: initialize project structure with Next.js, Prisma, and Tailwind CSS setup
This commit is contained in:
27
scripts/create-super-admin.js
Normal file
27
scripts/create-super-admin.js
Normal file
@@ -0,0 +1,27 @@
|
||||
const { PrismaClient } = require('@prisma/client');
|
||||
const bcrypt = require('bcryptjs');
|
||||
|
||||
const prisma = new PrismaClient();
|
||||
|
||||
async function main() {
|
||||
const hashedPassword = await bcrypt.hash('test', 10); // Changez le mot de passe ici
|
||||
await prisma.user.upsert({
|
||||
where: { email: 'test@test.fr' },
|
||||
update: {},
|
||||
create: {
|
||||
email: 'test@test.fr',
|
||||
password: hashedPassword,
|
||||
role: 'SUPER_ADMIN',
|
||||
},
|
||||
});
|
||||
console.log('Super admin created');
|
||||
}
|
||||
|
||||
main()
|
||||
.catch((e) => {
|
||||
console.error(e);
|
||||
process.exit(1);
|
||||
})
|
||||
.finally(async () => {
|
||||
await prisma.$disconnect();
|
||||
});
|
||||
Reference in New Issue
Block a user