Adding a new column sounds simple, but it touches every layer. Schema migrations must stay atomic. Changes must roll out safely to production without downtime. Performance and compatibility depend on precise execution.
First, define the column in your database migration file. Choose the correct data type, set constraints, and decide on default values. Avoid adding NOT NULL without a default to large tables—it can lock writes for minutes. In PostgreSQL, a nullable column with no default is instant to add, so use that when possible to ship fast.
Second, update all queries and models to support the new column. Check SELECT statements, inserts, and ORM definitions. Add tests to confirm both old and new data paths work. This is the step that keeps your deployments safe.