import { pool } from './src/db'; import { runWithTenantDataAccess } from './src/services/tenantSchemaService'; async function main() { const branch = process.argv[2] || 'BR002'; await runWithTenantDataAccess(branch, async () => { for (const t of ['supplier_preparations','purchase_order_items','inspections','purchase_orders']) { const cols = await pool.query( `SELECT column_name FROM information_schema.columns WHERE table_name=$1 AND table_schema=current_schema() ORDER BY ordinal_position`, [t]); console.log(`${t}:`, cols.rows.map((r) => r.column_name).join(', ')); console.log(''); } }); await pool.end(); } main().catch((e) => { console.error(e); process.exit(1); });