Created migration application scripts and comprehensive documentation: - scripts/apply-migration.js - Automated migration (requires service role key) - scripts/verify-migration.js - Table verification script - scripts/test-env.js - Environment diagnostics - supabase/APPLY_MIGRATION.md - Comprehensive migration guide - supabase/MIGRATION_INSTRUCTIONS.md - Quick reference Manual application via Supabase dashboard is recommended approach. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
34 lines
1.2 KiB
JavaScript
34 lines
1.2 KiB
JavaScript
const fs = require('fs');
|
|
const path = require('path');
|
|
|
|
// Load .env.local manually
|
|
const envPath = path.join(__dirname, '..', '.env.local');
|
|
console.log('Loading from:', envPath);
|
|
console.log('File exists:', fs.existsSync(envPath));
|
|
|
|
if (fs.existsSync(envPath)) {
|
|
const envContent = fs.readFileSync(envPath, 'utf8');
|
|
console.log('\nFile content length:', envContent.length);
|
|
console.log('First 200 chars:', envContent.substring(0, 200));
|
|
|
|
envContent.split('\n').forEach((line, idx) => {
|
|
const trimmed = line.trim();
|
|
console.log(`Line ${idx}: "${trimmed.substring(0, 50)}"`);
|
|
const match = trimmed.match(/^([^=:#]+)=(.*)$/);
|
|
if (match) {
|
|
const key = match[1].trim();
|
|
const value = match[2].trim();
|
|
console.log(` -> Matched: ${key} = ${value.substring(0, 20)}...`);
|
|
if (!process.env[key]) {
|
|
process.env[key] = value;
|
|
}
|
|
} else if (trimmed && !trimmed.startsWith('#')) {
|
|
console.log(' -> No match!');
|
|
}
|
|
});
|
|
}
|
|
|
|
console.log('\nFinal env vars:');
|
|
console.log('NEXT_PUBLIC_SUPABASE_URL:', process.env.NEXT_PUBLIC_SUPABASE_URL);
|
|
console.log('NEXT_PUBLIC_SUPABASE_ANON_KEY:', process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY ? 'SET' : 'NOT SET');
|