update Stories
All checks were successful
Deploy to Production / deploy (push) Successful in 20s

This commit is contained in:
silverpro89
2026-02-24 16:31:06 +07:00
parent d0f41920f7
commit 65820bb938
4 changed files with 207 additions and 16 deletions

29
sync-story.js Normal file
View File

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