
import { createRequire } from 'module';
import db from '../src/database/models/index.js';

const require = createRequire(import.meta.url);
const geoSeeder = require('../seeders/20240127-seed-geo-data.js');

async function seed() {
    console.log('🌱 Starting Geo Data Seeding...');
    try {
        await db.sequelize.authenticate();
        console.log('Connection established.');

        const queryInterface = db.sequelize.getQueryInterface();

        console.log('Executing seeder...');
        await geoSeeder.up(queryInterface, db.Sequelize);

        console.log('✅ Seeding completed successfully.');
        process.exit(0);
    } catch (error) {
        console.error('❌ Seeding failed:', error);
        process.exit(1);
    }
}

seed();
