update new API
All checks were successful
Deploy to Production / deploy (push) Successful in 29s

This commit is contained in:
silverpro89
2026-02-09 23:17:03 +07:00
parent f91cda796e
commit 5957636b07
101 changed files with 6998 additions and 1996 deletions

View File

@@ -0,0 +1,53 @@
const { sequelize } = require('./config/database');
const { Vocab } = require('./models');
async function checkImport() {
try {
await sequelize.authenticate();
console.log('✅ Database connection OK\n');
// Count all familynfriend vocabs
const totalCount = await Vocab.count({
where: { etc: 'familynfriend' }
});
console.log(`📊 Total familynfriend vocabulary: ${totalCount}`);
// Get some sample records
const samples = await Vocab.findAll({
where: { etc: 'familynfriend' },
limit: 10,
order: [['grade', 'ASC']]
});
console.log('\n📋 Sample records:');
samples.forEach(v => {
console.log(` - ${v.text} (grade: ${v.grade}, etc: ${v.etc})`);
});
// Count by grade prefix
const gradeCount = await sequelize.query(
`SELECT
FLOOR(grade / 100000) as grade_num,
COUNT(*) as count
FROM vocab
WHERE etc = 'familynfriend'
GROUP BY grade_num
ORDER BY grade_num`,
{ type: sequelize.QueryTypes.SELECT }
);
console.log('\n📊 Count by grade:');
gradeCount.forEach(g => {
const gradeName = `Grade ${g.grade_num}`;
console.log(` ${gradeName}: ${g.count} words`);
});
process.exit(0);
} catch (error) {
console.error('❌ Error:', error.message);
process.exit(1);
}
}
checkImport();