28 lines
809 B
JavaScript
28 lines
809 B
JavaScript
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);
|
|
}
|
|
})();
|