backward-compatible-schema-changes
Backward-Compatible Schema Changes
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 18
- Forks
- 6
01 前言 Front Matter
- name
- backward-compatible-schema-changes
- metadata
- { "original-index": 7, "short-description": "Backward-Compatible Schema Changes" }
- description
- Backward-Compatible Schema Changes
02 资源文件 1
- 参考文档skill.json167 B
03 SKILL.md 正文
Backward-Compatible Schema Changes
What
Making database schema changes that don't break existing application code. The application continues working without any code changes, even though the database structure has been modified.
Why
In production systems, you can't deploy database changes and application changes at the exact same millisecond. There's always a window where the old app code runs against the new schema (or vice versa). Backward-compatible changes eliminate this risk.
How
Column renames with preserved parameter names
-- The procedure parameter keeps the OLD name
CREATE OR REPLACE PROCEDURE public."AddApplicant"(
...
"p_vertirnarytechorassistant" boolean, -- old spelling preserved
...
)
AS $$
BEGIN
INSERT INTO public."Applicant" (
...
"the clientTechOrAssistant", -- new spelling in column ref
...
) VALUES (
...
p_vertirnarytechorassistant, -- old spelling in param ref (no quotes)
...
);
END;
$$ LANGUAGE plpgsql;
The application calls:
CALL public."AddApplicant"(
p_vertirnarytechorassistant => true -- still works!
);
The principle
| Layer | What Changed | What Stayed |
|---|---|---|
| Table column name | "VertirnaryTechOrAssistant" -> "the clientTechOrAssistant" |
Data, type, constraints |
| Procedure body | Quoted column refs updated | Everything else |
| Procedure signature | Nothing | Parameter names, types, order |
| Application code | Nothing | Call syntax, parameter binding |
When to Use
- Any schema change on a system with active callers
- When you can't coordinate simultaneous DB + app deployments
- As a two-phase approach: rename columns now, rename parameters later
Where We Used It
- ****: Renamed 4 columns and updated procedure bodies while preserving
all
p_parameter names. Application code continues working unchanged. Parameter name cleanup deferred to a future ticket after app coordination.
Gotchas
- Document the "debt" -- old parameter names should eventually be cleaned up
- Test with the actual application, not just SQL queries
- Named parameter binding (
p_name => value) is sensitive to parameter names; positional binding is not
*Category: Strategy | Origin: *
04 同仓库更多 Skills
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`).
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.
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.
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.
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.
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.