backward-compatible-schema-changeslisted
Install: claude install-skill CarlosCaPe/octorato
# 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
```sql
-- 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:
```sql
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, type