Branchwell

Become a Pro / website · becomeapro.ai / scripts / rename-tool-count-column.sql

Raw 435 B on 6c7ce85c3441baadd17890ab9cc9bf8ed5112901
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
5ALTER TABLE categories
6RENAME COLUMN tool_count TO instance_count;
7
8-- Verify the change
9SELECT column_name, data_type, is_nullable
10FROM information_schema.columns
11WHERE table_schema = 'public'
12AND table_name = 'categories'
13ORDER BY ordinal_position;