The migration failed on the last column. You watch the logs scroll like falling rain, but the fix is clear: add a new column.
Creating a new column in a database table is one of the most common schema changes. Done right, it is safe, fast, and sets the stage for clean feature growth. Done wrong, it can lock tables, block writes, and break production.
In SQL, adding a column is straightforward:
ALTER TABLE users ADD COLUMN last_login TIMESTAMP;
This changes the table structure without touching existing rows. Many engines optimize for this, but some will rewrite the entire table if a default value is set without NULL. Test the ALTER TABLE behavior in a staging environment before production.
When adding a new column in PostgreSQL, avoid heavy defaults, and use NOT NULL only after backfilling data. MySQL and MariaDB can block on large tables, so consider ONLINE DDL features where available. In distributed systems like CockroachDB or TiDB, schema changes are asynchronous—monitor them until completion.