Adding a new column sounds simple. It isn’t. Schema changes touch data, queries, indexes, and sometimes entire systems. The wrong approach can lock tables, drop performance, or break production. The right approach is safe, fast, and reversible.
Start by defining the new column in a migration file. Use an explicit data type and default value when needed. Avoid adding a NOT NULL constraint at creation if the table is large and populated. That forces a full rewrite. Instead, add the column as nullable, backfill in controlled batches, then set constraints after the data is in place.
Check query plans. Even if you aren’t indexing the new column, ORM-generated queries may change. Monitor execution times before and after deployment. In PostgreSQL, adding a column with a default can be instant in newer versions, but older versions still rewrite the table. Know your database’s exact behavior.