The table is broken. The data is here, but the structure is wrong. You don’t need another migration that takes hours. You need a new column.
A new column is the simplest, fastest way to expand your schema without risking downtime. Add fields. Store new metadata. Track events that didn’t exist when you first designed it. Good data models adapt to change, and adding a column is how you evolve without blowing up production.
In SQL, the process is direct. ALTER TABLE creates your new column. Set the right data type and constraints. Always plan defaults for non-null columns to avoid insert errors. Name it cleanly — no cryptic codes. Poor naming slows every future query.
For PostgreSQL, adding a new column with ALTER TABLE my_table ADD COLUMN status TEXT DEFAULT 'pending' NOT NULL; happens instantly for small tables. For massive datasets, think about locks. Use ADD COLUMN with defaults that don’t force a full rewrite, or backfill asynchronously.
In MySQL, ALTER TABLE my_table ADD COLUMN status VARCHAR(20) DEFAULT 'pending'; is common. But choose storage engines wisely — InnoDB and MyISAM behave differently under schema changes. Test on a replica before running in production.