update sentences API
All checks were successful
Deploy to Production / deploy (push) Successful in 22s
All checks were successful
Deploy to Production / deploy (push) Successful in 22s
This commit is contained in:
34
sync-sentences.js
Normal file
34
sync-sentences.js
Normal 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();
|
||||
Reference in New Issue
Block a user