A new column can be added in multiple ways. In SQL, the basic syntax is:
ALTER TABLE table_name ADD COLUMN column_name data_type;
This works for most engines—PostgreSQL, MySQL, SQLite—but the impact depends on storage engine, indexes, and constraints. On large tables, adding a column with a default value can rewrite the entire table, which can block reads and writes. Avoid that by adding the column without defaults, then updating values in smaller batches.
Non-null constraints require careful planning. First, add the column as nullable. Backfill data in increments, verifying rows after each update. Once complete, add the non-null constraint in a separate migration. This keeps the change safe and reversible.