A new column in a relational database can store additional attributes, track new metrics, or support new features. The goal is to add it without breaking existing queries or downtime. Schema changes can affect production performance, so the process matters as much as the design.
First, define the purpose of the new column. Decide the data type, default value, and whether it allows NULLs. Keep it minimal—every new column changes the shape and cost of storage.
Next, choose the migration strategy. In PostgreSQL or MySQL, an ALTER TABLE statement is common:
ALTER TABLE users
ADD COLUMN last_login TIMESTAMP DEFAULT CURRENT_TIMESTAMP;
For small tables, this is quick. For large datasets, use an online schema change tool or run the migration in multiple steps. Add the column empty, backfill in batches, then set constraints and defaults after verifying the data.