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

This commit is contained in:
silverpro89
2026-02-06 11:28:06 +07:00
parent 97dbbd4d12
commit aaba22b40c
12 changed files with 1375 additions and 49 deletions

27
rename-img-prompt.js Normal file
View File

@@ -0,0 +1,27 @@
const {sequelize} = require('./config/database');
(async () => {
try {
await sequelize.authenticate();
console.log('✅ Database connected');
// Rename promptForImage to img_prompt
await sequelize.query(`
ALTER TABLE context
CHANGE COLUMN promptForImage img_prompt JSON
COMMENT 'Prompt configuration object'
`);
console.log('✅ Renamed promptForImage to img_prompt');
// Show final structure
const [cols] = await sequelize.query('DESCRIBE context');
console.log('\n📊 Final Context table structure:');
cols.forEach((c, i) => console.log(` ${i+1}. ${c.Field} (${c.Type})`));
process.exit(0);
} catch (error) {
console.error('❌ Error:', error.message);
console.error(error.stack);
process.exit(1);
}
})();