Craig Kerstiens 10/1/2014

A simple guide for DB migrations

Read Original

This article explains a common pitfall in PostgreSQL: adding a NOT NULL constraint to a new column can rewrite the entire table and cause downtime. It provides a step-by-step, safer migration strategy: first add the column as nullable with a default, then backfill values in a background job, and finally add the NOT NULL constraint to ensure application uptime.

A simple guide for DB migrations

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser

Top of the Week