The database table sat there, complete but empty of the field you needed. You knew the schema had to change. You needed a new column.
Adding a new column is one of the most common schema migrations. It seems simple, but the choices you make here can dictate performance, data integrity, and deployment safety for years.
Start by defining the purpose of the new column. Know its data type and constraints before you touch production. A NULL-permitted column without defaults can deploy fast, but it may complicate queries later. A NOT NULL column with a default value will pre-fill rows, which can lock tables in some databases.
In PostgreSQL, use explicit ALTER TABLE commands and avoid implicit casts. In MySQL or MariaDB, remember that adding a column may rewrite the entire table, which can spike downtime. For large datasets, consider online schema migration tools like pt-online-schema-change or gh-ost.