2 * Migration script: Add platform column to agents table
3 * Run with: node scripts/migrate_add_platform.js
6const pool = require('../services/db');
11async function migrate() {
13 console.log('Adding platform column to agents table...');
16 ALTER TABLE agents ADD COLUMN IF NOT EXISTS platform VARCHAR(50);
19 console.log('✅ Migration successful');
21 // Update existing agents
22 const result = await pool.query(`
23 UPDATE agents SET platform = 'unknown' WHERE platform IS NULL;
26 console.log(`✅ Updated ${result.rowCount} existing agents`);
30 console.error('❌ Migration failed:', err);