Files
tourrism_site/database/check-article-categories.js
Andrey K. Choi b4e513e996 🚀 Korea Tourism Agency - Complete implementation
 Features:
- Modern tourism website with responsive design
- AdminJS admin panel with image editor integration
- PostgreSQL database with comprehensive schema
- Docker containerization
- Image upload and gallery management

🛠 Tech Stack:
- Backend: Node.js + Express.js
- Database: PostgreSQL 13+
- Frontend: HTML/CSS/JS with responsive design
- Admin: AdminJS with custom components
- Deployment: Docker + Docker Compose
- Image Processing: Sharp with optimization

📱 Admin Features:
- Routes/Tours management (city, mountain, fishing)
- Guides profiles with specializations
- Articles and blog system
- Image editor with upload/gallery/URL options
- User management and authentication
- Responsive admin interface

🎨 Design:
- Korean tourism focused branding
- Mobile-first responsive design
- Custom CSS with modern aesthetics
- Image optimization and gallery
- SEO-friendly structure

🔒 Security:
- Helmet.js security headers
- bcrypt password hashing
- Input validation and sanitization
- CORS protection
- Environment variables
2025-11-30 00:53:15 +09:00

40 lines
1.2 KiB
JavaScript

import db from '../src/config/database.js';
async function checkArticleCategories() {
try {
console.log('🔍 Проверяем ограничения на категории articles...');
// Проверяем constraint (для новых версий PostgreSQL)
const constraints = await db.query(`
SELECT conname, pg_get_constraintdef(oid) as definition
FROM pg_constraint
WHERE conrelid = 'articles'::regclass
AND contype = 'c'
`);
console.log('\n📋 Ограничения articles:');
constraints.rows.forEach(row => {
console.log(` - ${row.conname}: ${row.definition}`);
});
// Проверяем существующие категории
const existingCategories = await db.query(`
SELECT DISTINCT category
FROM articles
WHERE category IS NOT NULL
ORDER BY category
`);
console.log('\n📂 Существующие категории:');
existingCategories.rows.forEach(row => {
console.log(` - ${row.category}`);
});
} catch (error) {
console.error('❌ Ошибка:', error.message);
}
process.exit(0);
}
checkArticleCategories();