AI Resource Pro / website / scripts / column-check.sql
| 1 | -- SQL to check which columns exist in the categories table |
| 2 | -- Run this first to confirm what columns are available |
| 3 | |
| 4 | -- Check table structure |
| 5 | SELECT |
| 6 | column_name, |
| 7 | data_type, |
| 8 | is_nullable |
| 9 | FROM |
| 10 | information_schema.columns |
| 11 | WHERE |
| 12 | table_schema = 'public' |
| 13 | AND table_name = 'categories' |
| 14 | ORDER BY |
| 15 | ordinal_position; |
| 16 | |
| 17 | -- Count how many categories exist |
| 18 | SELECT COUNT(*) AS total_categories FROM categories; |
| 19 | |
| 20 | -- Sample a few rows to see current data |
| 21 | SELECT |
| 22 | id, name, instance_count, created_at, updated_at |
| 23 | FROM |
| 24 | categories |
| 25 | ORDER BY |
| 26 | name |
| 27 | LIMIT 5; |