You check the schema. The answer is clear: you need a new column.
Adding a new column is one of the most common changes in any database lifecycle. It sounds simple, but the wrong approach can lock tables, spike CPU, or force downtime. The right method avoids risk, keeps migrations reversible, and scales with future updates.
First, know your environment. In PostgreSQL, ALTER TABLE ADD COLUMN is straightforward, but adding with a default value writes to every row. On large tables, this can cause long transactions. Break it up: add the column without a default, then backfill in batches.
In MySQL, the storage engine matters. InnoDB supports fast metadata-only operations for some ADD COLUMN commands, but older versions perform full table rebuilds. Always review the execution plan with SHOW CREATE TABLE before proceeding.
For production databases, treat schema migrations as code. Version control every change. Test the migration on realistic data sets before shipping. Use transactional DDL where supported, or wrap operations in application-level safeguards if not.