mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-03-26 18:41:12 -04:00
29 lines
564 B
TypeScript
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);
|
|
});
|