Initial commit: API Debug Tool

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
jason
2026-03-12 04:32:35 +08:00
commit 96bdc292bb
42 changed files with 8577 additions and 0 deletions

View 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();