const { PrismaClient } = require("@prisma/client"); const prisma = new PrismaClient(); async function addButtonWebType() { try { console.log("๐Ÿ” ๋ฒ„ํŠผ ์›นํƒ€์ž… ํ™•์ธ ์ค‘..."); // ๊ธฐ์กด button ์›นํƒ€์ž… ํ™•์ธ const existingButton = await prisma.web_type_standards.findUnique({ where: { web_type: "button" }, }); if (existingButton) { console.log("โœ… ๋ฒ„ํŠผ ์›นํƒ€์ž…์ด ์ด๋ฏธ ์กด์žฌํ•ฉ๋‹ˆ๋‹ค."); console.log("๐Ÿ“„ ๊ธฐ์กด ์„ค์ •:", JSON.stringify(existingButton, null, 2)); return; } console.log("โž• ๋ฒ„ํŠผ ์›นํƒ€์ž… ์ถ”๊ฐ€ ์ค‘..."); // ๋ฒ„ํŠผ ์›นํƒ€์ž… ์ถ”๊ฐ€ const buttonWebType = await prisma.web_type_standards.create({ data: { web_type: "button", type_name: "๋ฒ„ํŠผ", type_name_eng: "Button", description: "ํด๋ฆญ ๊ฐ€๋Šฅํ•œ ๋ฒ„ํŠผ ์ปดํฌ๋„ŒํŠธ", category: "action", component_name: "ButtonWidget", config_panel: "ButtonConfigPanel", default_config: { actionType: "custom", variant: "default", }, sort_order: 100, is_active: "Y", created_by: "system", updated_by: "system", }, }); console.log("โœ… ๋ฒ„ํŠผ ์›นํƒ€์ž…์ด ์„ฑ๊ณต์ ์œผ๋กœ ์ถ”๊ฐ€๋˜์—ˆ์Šต๋‹ˆ๋‹ค!"); console.log("๐Ÿ“„ ์ถ”๊ฐ€๋œ ์„ค์ •:", JSON.stringify(buttonWebType, null, 2)); } catch (error) { console.error("โŒ ๋ฒ„ํŠผ ์›นํƒ€์ž… ์ถ”๊ฐ€ ์‹คํŒจ:", error); } finally { await prisma.$disconnect(); } } addButtonWebType();