// Migration: Create vcl_vertical_metadata table for editable team-level notes, RAs, and compliance dates
const pool = require('../db');

async function run() {
    console.log('Starting vcl_vertical_metadata migration...');
    try {
        await pool.query(`
            CREATE TABLE IF NOT EXISTS vcl_vertical_metadata (
                id SERIAL PRIMARY KEY,
                team TEXT NOT NULL UNIQUE,
                notes TEXT DEFAULT '',
                risk_acceptances INTEGER DEFAULT 0,
                compliance_date TEXT DEFAULT NULL,
                updated_at TIMESTAMPTZ DEFAULT NOW()
            )
        `);
        console.log('✓ vcl_vertical_metadata table created (or already exists)');
    } catch (err) {
        console.error('Migration error:', err.message);
        process.exit(1);
    }
    console.log('Migration complete.');
    process.exit(0);
}

run();
