Migration Rules
ℹ️
Avoid breaking changes. Rollbacks must always work without requiring migration rollbacks.
- Do not rename tables.
- Do not rename columns.
- Do not change column types.
How to Safely change table or column
- Create a new table or column.
- Start writing data to both the old and the new structure.
- Deploy the new version of the application and run the migration.
- Backfill existing data into the new structure before relying on it.
- Switch reads to use the new table or column.
- Deploy the updated version of the application.
- Remove the old table or column once it is no longer needed.