Files
cim_summary/backend/check-columns.js
Jon 185c780486
Some checks failed
CI/CD Pipeline / Backend - Lint & Test (push) Has been cancelled
CI/CD Pipeline / Frontend - Lint & Test (push) Has been cancelled
CI/CD Pipeline / Security Scan (push) Has been cancelled
CI/CD Pipeline / Build Backend (push) Has been cancelled
CI/CD Pipeline / Build Frontend (push) Has been cancelled
CI/CD Pipeline / Integration Tests (push) Has been cancelled
CI/CD Pipeline / Deploy to Staging (push) Has been cancelled
CI/CD Pipeline / Deploy to Production (push) Has been cancelled
CI/CD Pipeline / Performance Tests (push) Has been cancelled
CI/CD Pipeline / Dependency Updates (push) Has been cancelled
🚀 Update to Claude 3.7 latest and fix LLM processing issues
- Updated Anthropic API to latest version (2024-01-01)
- Set Claude 3.7 Sonnet Latest as primary model
- Removed deprecated Opus 3.5 references
- Fixed LLM response validation and JSON parsing
- Improved error handling and logging
- Updated model configurations and pricing
- Enhanced document processing reliability
- Fixed TypeScript type issues
- Updated environment configuration
2025-08-17 17:31:56 -04:00

83 lines
2.6 KiB
JavaScript

#!/usr/bin/env node
const { createClient } = require('@supabase/supabase-js');
require('dotenv').config();
const supabaseUrl = process.env.SUPABASE_URL;
const supabaseServiceKey = process.env.SUPABASE_SERVICE_KEY;
const supabase = createClient(supabaseUrl, supabaseServiceKey);
async function checkColumns() {
console.log('🔍 Checking actual column names...\n');
try {
// Check documents table
console.log('📋 Documents table columns:');
const { data: docData, error: docError } = await supabase
.from('documents')
.select('*')
.limit(0);
if (docError) {
console.log('❌ Error accessing documents table:', docError.message);
} else {
console.log('✅ Documents table accessible');
}
// Check users table
console.log('\n📋 Users table columns:');
const { data: userData, error: userError } = await supabase
.from('users')
.select('*')
.limit(0);
if (userError) {
console.log('❌ Error accessing users table:', userError.message);
} else {
console.log('✅ Users table accessible');
}
// Check processing_jobs table
console.log('\n📋 Processing_jobs table columns:');
const { data: jobData, error: jobError } = await supabase
.from('processing_jobs')
.select('*')
.limit(0);
if (jobError) {
console.log('❌ Error accessing processing_jobs table:', jobError.message);
} else {
console.log('✅ Processing_jobs table accessible');
}
// Try to get column information using SQL
console.log('\n🔍 Getting column details via SQL...');
const { data: columns, error: sqlError } = await supabase.rpc('exec_sql', {
sql: `
SELECT
table_name,
column_name,
data_type
FROM information_schema.columns
WHERE table_name IN ('documents', 'users', 'processing_jobs')
ORDER BY table_name, ordinal_position;
`
});
if (sqlError) {
console.log('❌ SQL error:', sqlError.message);
} else {
console.log('📋 Column details:');
columns.forEach(col => {
console.log(` ${col.table_name}.${col.column_name} (${col.data_type})`);
});
}
} catch (error) {
console.log('❌ Error:', error.message);
}
}
checkColumns();