Databases · Senior · Question 68 of 75
What is a safe sequence for dropping a column in a system with rolling deploys?
- 1Drop it first, then update the code
- ✓Correct answer: Stop reading and writing it in code and deploy that first (with ORMs, stop selecting it), then drop it in a later migration
- 3Drop it in the same deploy that removes it from the code
Explanation
Old instances still running during deploy would fail on a missing column. DROP COLUMN itself is fast in PostgreSQL: it only marks the column as dropped.