The code stopped working after you pushed the migration. The problem isn’t the data—it’s the schema. You forgot the new column.
Adding a new column is one of the most common changes in modern databases. It happens across PostgreSQL, MySQL, SQLite, and every major engine. Yet it’s also one of the highest-risk schema updates when speed and uptime matter.
A new column changes the table definition. In relational databases, this means altering the table metadata to include the new field, its type, constraints, and defaults. If a default value is non-nullable and not computed, the database must backfill every row. On large datasets, this can lock writes and block the application. Experienced teams know that adding a nullable column first, then backfilling in batches, keeps systems online.
When adding a new column in PostgreSQL, ALTER TABLE ... ADD COLUMN is straightforward. If a default is declared, Postgres will rewrite the entire table. Instead, add the column without a default, then run an UPDATE in chunks, then ALTER COLUMN ... SET DEFAULT afterward. In MySQL, certain storage engines like InnoDB can add a column instantly if conditions are met, but older versions still rebuild the table. SQLite’s ALTER TABLE ADD COLUMN is fast if no default or NOT NULL is enforced.