Adding a new column is one of the most common schema changes in databases. The right approach depends on the database engine, the size of the dataset, and how the application reads from it. In PostgreSQL, ALTER TABLE ADD COLUMN is straightforward for small tables, but on large datasets it can lock rows for longer than expected. Using ADD COLUMN ... DEFAULT avoids repeated writes by setting a constant default in the metadata. In MySQL, the same ALTER TABLE command can be instant if no data rewrite is required, but certain storage engines still lock the table.
For production systems, adding a new column must be planned to avoid downtime. Online schema change tools such as gh-ost or pt-online-schema-change can create the column without blocking reads or writes. They work by creating a shadow table, migrating data in chunks, and swapping tables after syncing changes.
Schema migrations in ORMs should generate ADD COLUMN statements explicitly and run them in controlled deployments. Avoid adding expensive default expressions in a migration, because they force a full table rewrite. Instead, add a column as nullable, backfill data in batches, then apply constraints or defaults after data is in place.