// createAdmin.js
const bcrypt = require('bcryptjs');
const db = require('./models');

async function createAdmin() {
  const hashedPassword = await bcrypt.hash('ABCDefgh8@Diet@Acm', 10);

  try {
    const admin = await db.Admin.create({
      email: 'dietacmchapter@diet.edu.in',
      password: hashedPassword
    });
    console.log('✅ Admin created:', admin.email);
  } catch (err) {
    console.error('❌ Error creating admin:', err);
  }

  process.exit();
}

createAdmin();
