update context API
All checks were successful
Deploy to Production / deploy (push) Successful in 19s
All checks were successful
Deploy to Production / deploy (push) Successful in 19s
This commit is contained in:
27
rename-img-prompt.js
Normal file
27
rename-img-prompt.js
Normal 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);
|
||||
}
|
||||
})();
|
||||
Reference in New Issue
Block a user