AGENT SKILL

multi-object-rename-convergence

Multi-Object Rename Convergence

License 许可
MIT
最近更新
2026-11-14
Stars
★ 18
Forks
6

01 前言 Front Matter

name
multi-object-rename-convergence
metadata
{ "original-index": 19, "short-description": "Multi-Object Rename Convergence" }
description
Multi-Object Rename Convergence

02 资源文件 1

03 SKILL.md 正文

Multi-Object Rename Convergence

What

Renaming a table and cascading that rename through all dependent objects: FK columns across N child tables, views, stored procedures, indexes, and constraints. A full-stack rename that goes far beyond a single column rename.

Why

Renaming a table touches every layer of the schema. Unlike a column rename (Skill #05, metadata-only, no dependents break), a table rename has a blast radius that includes:

  • Foreign key columns in child tables (named after the old table)
  • Views that SELECT FROM the old table name
  • Stored procedures that reference the old table
  • Indexes and constraints named after the old table
  • Application code and ORM mappings

How

Phase 1: Inventory all dependents

-- Find all FK references to the old table
SELECT conname, conrelid::regclass AS child_table
FROM pg_constraint
WHERE confrelid = 'public."Scribe"'::regclass;

-- Find all views referencing the old table
SELECT viewname FROM pg_views
WHERE definition LIKE '%"Scribe"%';

-- Find all procedures referencing the old table
SELECT proname FROM pg_proc
WHERE prosrc LIKE '%"Scribe"%';

Phase 2: Rename the table

ALTER TABLE public."Scribe" RENAME TO "Recording";

Phase 3: Rename FK columns in child tables

-- In each child table, rename the FK column
ALTER TABLE public."ReportWords"
    RENAME COLUMN "ScribeId" TO "RecordingId";

Phase 4: Rebuild views and procedures

Use pg_get_functiondef (Skill #06) for procedures, and CREATE OR REPLACE VIEW for views, replacing all references to the old name.

Phase 5: Rename indexes and constraints

ALTER INDEX "IX_Scribe_HospitalId" RENAME TO "IX_Recording_HospitalId";
ALTER TABLE public."Recording"
    RENAME CONSTRAINT "PK_Scribe" TO "PK_Recording";

When to Use

  • Correcting misleading table names (Scribe -> Recording)
  • Standardizing naming conventions across the schema
  • Any rename where the old name propagated into dependent objects

Where We Used It

  • ****: Renamed Scribe/Transcription table to Recording + converged FK columns, views, procedures, and indexes
  • ****: Follow-up rename of remaining "Scribe" wording in object names and definitions

Related Skills

  • Skill #05 (Column Renames) -- metadata-only column renames within the cascade
  • Skill #06 (pg_get_functiondef) -- rebuild procedures referencing old names
  • Skill #14 (Research Checklist) -- inventory ALL dependents before renaming

Gotchas

  • Blast radius is large -- always inventory ALL dependents first (Skill #14)
  • Table renames are metadata-only, but view/procedure rebuilds are not trivial
  • Application code must be updated simultaneously or use backward-compatible views/aliases
  • Do in stages: table rename -> column renames -> view rebuilds -> procedure rebuilds -> index/constraint renames
  • Test with the application between each stage if possible

*Category: DDL | Origin: , *

04 同仓库更多 Skills

CarlosCaPe
CarlosCaPe/octorato

yeet

Use only when the user explicitly asks to stage, commit, push, and open a GitHub pull request in one flow using the GitHub CLI (`gh`).

★ 18
CarlosCaPe
CarlosCaPe/octorato

wrangler

Cloudflare Workers CLI for deploying, developing, and managing Workers, KV, R2, D1, Vectorize, Hyperdrive, Workers AI, Containers, Queues, Workflows, Pipelines, and Secrets Store. Load before running wrangler commands to ensure correct syntax and best practices. Biases towards retrieval from Cloudflare docs over pre-trained knowledge.

★ 18
CarlosCaPe
CarlosCaPe/octorato

workspace-skill-discovery

Discover and include ALL skills across the workspace — not just global ones. Use at the start of every session or when the user asks about available skills. Ensures project-level skills (under .claude/skills/ or skills/ in any repo) are never missed.

★ 18
CarlosCaPe
CarlosCaPe/octorato

workers-best-practices

Reviews and authors Cloudflare Workers code against production best practices. Load when writing new Workers, reviewing Worker code, configuring wrangler.jsonc, or checking for common Workers anti-patterns (streaming, floating promises, global state, secrets, bindings, observability). Biases towards retrieval from Cloudflare docs over pre-trained knowledge.

★ 18
CarlosCaPe
CarlosCaPe/octorato

winui-app

Create, build and design WinUI 3 desktop apps with C# and the Windows App SDK following Microsoft's official guidance and CommunityToolkit. Covers XAML, navigation, theming, accessibility and deployment.

★ 18
CarlosCaPe
CarlosCaPe/octorato

windows-brain-script-portability

Scripts in ~/.claude/scripts/ that run on a Windows brain: use the python3.cmd shim and not bare python3, and reconfigure stdout to UTF-8 if you print symbols. Use it when writing a brain script or triaging a Windows-only crash.

★ 18