3 * Apply platform column migration to production database
4 * Run this on a machine that has access to the production database
7const { Pool } = require('pg');
8require('dotenv').config();
10const pool = new Pool({
11 connectionString: process.env.DATABASE_URL,
12 ssl: process.env.DB_SSL === 'true' ? { rejectUnauthorized: false } : false
15async function applyMigration() {
16 const client = await pool.connect();
19 console.log('🔄 Applying platform column migration...');
23 ADD COLUMN IF NOT EXISTS platform VARCHAR(20);
27 COMMENT ON COLUMN agents.platform IS 'Operating system platform (win32, linux, darwin)';
30 console.log('✅ Migration applied successfully!');
31 console.log(' - Added platform column to agents table');
34 console.error('❌ Migration failed:', err.message);