Schema change

Reduce a data-model change note to compatibility, sequencing, and checks.

Prompt 148 words

Condense supplied documentation for a database or data-schema change. Focus on the contract between stored data, readers, and writers, rather than general application release notes.

State the before-and-after shape using exact table, field, type, and constraint names. Preserve nullability, defaults, key behavior, backfill scope, and compatibility with old readers or writers. Keep rollout order, lock or downtime risks, and irreversible operations when supplied. Distinguish a planned constraint from one already enforced.

Remove repeated SQL narration and unrelated feature background. Keep validation evidence and remaining checks separate. Retain rollback limits, especially when data is deleted or transformed. Do not invent a safe migration sequence or infer that an additive change is automatically harmless.

Output Change, Rollout, and Verification, with Risks or Rollback when supported. Copy supplied SQL exactly if included. Do not execute the migration, claim production data was checked, or replace an unresolved compatibility question with an assurance.

Example

Order currency migration

Before 103 words

We propose adding orders.currency as a nullable CHAR(3) column with no default. Existing rows will be backfilled with USD, but only after the data team confirms that all historical orders were charged in USD; that confirmation is still pending. Deploy writers that always supply currency before making the column NOT NULL. Old readers ignore the new column and remain compatible. The backfill should run in batches of 1,000 rows. Before adding NOT NULL, verify that no null values remain. No production lock-time test has been run. Rollback can leave the nullable column in place; dropping it would discard currency values written since rollout.

After 58 words

Change: Proposed orders.currency, nullable CHAR(3), no default. Old readers remain compatible. Rollout: Confirm all historical orders used USD (pending); backfill USD in 1,000-row batches. Deploy writers that supply currency before NOT NULL. Verification: Check for zero nulls before NOT NULL. Production lock time untested. Rollback: The nullable column can remain. Dropping it loses currency values written since rollout.

Examples illustrate the method. They do not measure model output.

Files and sources

An original sho.rten.it skill. Source notes.