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

This commit is contained in:
silverpro89
2026-02-24 14:29:23 +07:00
parent cfc83c983c
commit d3da098f6f
10 changed files with 1447 additions and 19 deletions

34
sync-sentences.js Normal file
View File

@@ -0,0 +1,34 @@
/**
* Sync only the Sentences model to database
*/
const { sequelize } = require('./config/database');
const Sentences = require('./models/Sentences');
async function syncSentences() {
try {
console.log('🔄 Syncing Sentences table...');
await sequelize.authenticate();
console.log('✅ Database connection OK');
await Sentences.sync({ alter: true });
console.log('✅ Sentences table synced successfully');
const [tables] = await sequelize.query("SHOW TABLES LIKE 'sentences'");
if (tables.length > 0) {
console.log('✅ Table "sentences" confirmed in database');
}
const [columns] = await sequelize.query("SHOW COLUMNS FROM sentences");
console.log('\n📋 Columns in sentences table:');
columns.forEach(col => {
console.log(` - ${col.Field} (${col.Type})`);
});
process.exit(0);
} catch (error) {
console.error('❌ Error syncing Sentences:', error.message);
process.exit(1);
}
}
syncSentences();