import { PrismaClient } from '@prisma/client'; const ITEMS = [ ['公开招标', 1], ['邀请招标', 2], ['询价', 3], ['竞谈【综合评分】', 4], ['竞谈【最低价中】', 5], ['单一来源', 6], ['其他', 7], ] as const; const prisma = new PrismaClient(); async function main() { await prisma.dictItem.deleteMany({ where: { tenantId: '1', dictType: 'tenderMethod' } }); await prisma.dictItem.createMany({ data: ITEMS.map(([value, sortNo]) => ({ tenantId: '1', dictType: 'tenderMethod', label: value, value, sortNo, })), }); console.log('tenderMethod dict synced', ITEMS.length); } main() .then(() => prisma.$disconnect()) .catch(async (e) => { console.error(e); await prisma.$disconnect(); process.exit(1); });