import { PrismaClient } from '@prisma/client'

const prisma = new PrismaClient()

async function main() {
  // Данные для заполнения
  const categories = [
    { id: 1, name: "Film" },
    { id: 2, name: "Theater" },
    { id: 3, name: "Music" },
    { id: 4, name: "Sports" },
    { id: 5, name: "Art" },
    { id: 6, name: "Legends" },
    { id: 7, name: "Anniversaries" },
    { id: 8, name: "Memory" },
  ];

  // Заполнение данных
  for (const category of categories) {
    await prisma.category.upsert({
      where: { id: category.id },
      update: {},
      create: category,
    });
  }

  console.log('Данные успешно добавлены!');
}

main()
  .catch((e) => {
    throw e;
  })
  .finally(async () => {
    await prisma.$disconnect();
  });