import 'reflect-metadata';
import { AppDataSource } from './data-source';
import { seedAchievements } from './achievements-seed';
import { seedCommunityGoals } from './community-goals-seed';

async function seed() {
  await AppDataSource.initialize();
  console.log('DB connectée (MySQL)');

  await seedAchievements(AppDataSource);
  await seedCommunityGoals(AppDataSource);

  await AppDataSource.destroy();
  console.log('✅ Sprint 4 seed terminé');
}

seed().catch((err) => {
  console.error('Seed échoué :', err);
  process.exit(1);
});
