Files
Compass/prisma/seed.ts
MartinBraquet f67ffa2701 Set Google Auth
2025-07-27 20:44:25 +02:00

29 lines
564 B
TypeScript

import { PrismaClient } from '@prisma/client';
import bcrypt from 'bcryptjs';
const prisma = new PrismaClient();
async function main() {
const users = await Promise.all([
prisma.user.create({
data: {
email: 'alice@example.com',
name: 'Alice',
password: await bcrypt.hash('password123', 10),
},
}),
]);
console.log('Seeding completed.');
}
main()
.then(async () => {
await prisma.$disconnect();
})
.catch(async (e) => {
console.error(e);
await prisma.$disconnect();
process.exit(1);
});