feat: Add bulk import from ISEN excel

This commit is contained in:
2025-11-20 18:00:29 +01:00
parent 1ce9055491
commit eb8132b20f
15 changed files with 1397 additions and 2017 deletions

View File

@@ -0,0 +1,30 @@
const { PrismaClient } = require('@prisma/client');
const bcrypt = require('bcryptjs');
const prisma = new PrismaClient();
async function main() {
console.log('Updating passwords for users requiring reset...');
const hashedPassword = await bcrypt.hash('123456', 10);
const result = await prisma.user.updateMany({
where: {
passwordResetRequired: true,
},
data: {
password: hashedPassword,
},
});
console.log(`Updated ${result.count} users with temporary password "123456"`);
}
main()
.catch((e) => {
console.error(e);
process.exit(1);
})
.finally(async () => {
await prisma.$disconnect();
});