23 lines
991 B
Markdown
23 lines
991 B
Markdown
# Migration Safety Notes
|
|
|
|
Treat migrations as a production data operation, not merely part of container startup.
|
|
|
|
Before applying a migration, inspect the revisions between current and target state. Pay special attention to:
|
|
|
|
- dropping tables/columns/indexes/constraints;
|
|
- renaming without compatibility window;
|
|
- adding required columns to populated tables;
|
|
- new unique constraints over existing data;
|
|
- foreign keys with orphaned historical rows;
|
|
- enum/type narrowing or conversion;
|
|
- large backfills or full-table rewrites;
|
|
- long-running DDL/lock behavior;
|
|
- application versions that cannot operate before/after the migration;
|
|
- downgrade steps that do not restore lost data.
|
|
|
|
Prefer expand/migrate/contract patterns for changes that must support rolling or reversible deployments.
|
|
|
|
A syntactically valid migration is not proof that it is safe against production data.
|
|
|
|
If migration validation cannot be performed, report the exact uncertainty and do not call the data gate passed.
|