-- SQL to drop the tool_count column from the categories table if it's no longer needed -- First, check if the column exists to prevent errors DO $$ BEGIN IF EXISTS ( SELECT 1 FROM information_schema.columns WHERE table_schema = 'public' AND table_name = 'categories' AND column_name = 'tool_count' ) THEN -- Drop the column ALTER TABLE categories DROP COLUMN tool_count; RAISE NOTICE 'Column tool_count has been dropped from categories table'; ELSE RAISE NOTICE 'Column tool_count does not exist in categories table'; END IF; END $$; -- Verify the current structure SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_schema = 'public' AND table_name = 'categories' ORDER BY ordinal_position;