require('dotenv').config(); const { Pool } = require('pg'); async function checkArticlesSchema() { const pool = new Pool({ connectionString: process.env.DATABASE_URL }); try { console.log('🔍 Проверяем структуру таблицы articles...'); const result = await pool.query(` SELECT column_name, data_type, is_nullable, column_default FROM information_schema.columns WHERE table_name = 'articles' ORDER BY ordinal_position `); console.log('\n📋 Структура таблицы articles:'); result.rows.forEach(row => { console.log(` - ${row.column_name}: ${row.data_type} ${row.is_nullable === 'NO' ? '(NOT NULL)' : '(nullable)'} ${row.column_default ? `default: ${row.column_default}` : ''}`); }); } catch (error) { console.error('❌ Ошибка:', error.message); } finally { await pool.end(); } } checkArticlesSchema();