Branchwell

AI Resource Pro / website / scripts / verify-migration.sql

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;