AI Resource Pro / website / scripts / rename-tool-count-column.sql
| 1 | -- SQL to rename the tool_count column to instance_count in the categories table |
| 2 | -- This better reflects that it counts instances across multiple content types |
| 3 | |
| 4 | -- Rename the column |
| 5 | ALTER TABLE categories |
| 6 | RENAME COLUMN tool_count TO instance_count; |
| 7 | |
| 8 | -- Verify the change |
| 9 | SELECT column_name, data_type, is_nullable |
| 10 | FROM information_schema.columns |
| 11 | WHERE table_schema = 'public' |
| 12 | AND table_name = 'categories' |
| 13 | ORDER BY ordinal_position; |