You open the migration file. One change will alter the schema — a new column.
Adding a new column is simple in theory, but precision matters. You define the column name, its type, constraints, and default values. In SQL, this means an ALTER TABLE statement:
ALTER TABLE users
ADD COLUMN last_login TIMESTAMP DEFAULT CURRENT_TIMESTAMP;
The database accepts it and the schema changes instantly. In practice, production systems carry risk. Every new column can impact queries, indexes, and application logic. A careless change can lock tables, slow performance, or break integrations.
Before adding a new column, you check dependencies. You review migrations for forward and backward compatibility. You write tests to ensure the application can read and write data with the new field. You consider nullability — forcing non-null values on an empty column will fail without defaults.