The database table was ready, but the product needed more. A new column would decide if the next feature shipped today or stayed in backlog.
Adding a new column is simple when planned, expensive when rushed. In SQL, the ALTER TABLE command is the starting point. Write it carefully:
ALTER TABLE users ADD COLUMN last_login TIMESTAMP;
This operation extends the schema without dropping existing data. But the details matter: column type, constraints, default values, and nullability all affect performance, storage, and query plans. A poorly defined column can lock large tables and block writes for minutes or hours.
For systems at scale, schema migrations must be coordinated. Zero-downtime deployments use techniques like creating the new column as nullable, backfilling in batches, and adding constraints later. Tools like Liquibase, Flyway, and built-in migration frameworks can sequence these steps while tracking history.