Branchwell

AI Resource Pro / website · airesourcepro.com / scripts / verify-migration.sql

Raw 384 B on 6c7ce85c3441baadd17890ab9cc9bf8ed5112901
1-- Check table structure
2SELECT column_name, data_type
3FROM information_schema.columns
4WHERE table_name = 'posts'
5ORDER BY ordinal_position;
6
7-- Show a sample post with its categories
8SELECT
9 bp.title,
10 array_agg(c.name) as categories
11FROM posts bp
12JOIN post_categories bpc ON bpc.post_id = bp.id
13JOIN categories c ON c.id = bpc.category_id
14GROUP BY bp.id, bp.title
15LIMIT 1;