Initial commit: API Debug Tool
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
20
server/update_endpoints_table.js
Normal file
20
server/update_endpoints_table.js
Normal file
@@ -0,0 +1,20 @@
|
||||
const { pool } = require('./db');
|
||||
|
||||
async function migrate() {
|
||||
try {
|
||||
console.log('Checking endpoints table for query_params column...');
|
||||
const [columns] = await pool.query(`SHOW COLUMNS FROM endpoints LIKE 'query_params'`);
|
||||
if (columns.length === 0) {
|
||||
console.log('Adding query_params column...');
|
||||
await pool.query(`ALTER TABLE endpoints ADD COLUMN query_params JSON`);
|
||||
console.log('query_params column added successfully.');
|
||||
} else {
|
||||
console.log('query_params column already exists.');
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('Migration failed:', err);
|
||||
} finally {
|
||||
process.exit();
|
||||
}
|
||||
}
|
||||
migrate();
|
||||
Reference in New Issue
Block a user