import { PrismaClient } from "@prisma/client"; import bcrypt from "bcrypt"; import { v4 as uuidv4 } from "uuid"; const prisma = new PrismaClient(); async function seed() { try { const adminUser = await prisma.user.create({ data: { email: "admin@example.com", nickname: "관리자", name: "test", passwordHash: await bcrypt.hash("password123", 10), userAuthToken: uuidv4(), role: "ADMIN", status: true, }, }); console.log("시드 데이터 생성됨:", adminUser); } catch (error) { console.error("시드 데이터 생성 중 오류 발생:", error); process.exit(1); } finally { await prisma.$disconnect(); } } seed();