The query ran. The table stared back, unchanging. You needed a new column.
Adding a new column is simple in theory, dangerous in production. Done wrong, it locks rows, blocks writes, and drags latency through the floor. Done right, it delivers new features without breaking uptime.
First, define the column. In SQL, a new column starts with ALTER TABLE. But the command's effect depends on engine, storage, and indexes. In MySQL, adding a column with ALTER TABLE ... ADD COLUMN rewrites the whole table in older versions. In PostgreSQL, adding a nullable column without a default is instantaneous. Adding a column with a default value rewrites data.
Plan for the schema change. Check migrations against staging data. Measure with realistic row counts. If downtime is unacceptable, use an online schema change tool. Percona’s pt-online-schema-change or gh-ost can add a column without locking the table. On PostgreSQL, break the data change into steps: add the column nullable, backfill in batches, then add constraints.