const db = require('./config/database');

async function checkTableStructure() {
  try {
    const [rows] = await db.execute('DESCRIBE children');
    console.log('Children table structure:');
    rows.forEach(row => console.log(`Field: ${row.Field}, Type: ${row.Type}`));
    
    // Also check if there's a name field
    const [nameFieldCheck] = await db.execute(`
      SELECT COLUMN_NAME 
      FROM INFORMATION_SCHEMA.COLUMNS 
      WHERE TABLE_NAME = 'children' AND COLUMN_NAME = 'name'
    `);
    console.log('\nName field check:', nameFieldCheck);
    
    process.exit(0);
  } catch (error) {
    console.error('Error:', error.message);
    process.exit(1);
  }
}

checkTableStructure();
