The database was silent until the schema changed. You ran the migration, and the first test hit the new column. Everything after that moved faster.
Adding a new column is simple in theory but unforgiving in practice. The wrong type, nullability, or default can slow queries and break code in ways that surface days later. The right approach avoids surprises in production.
Start by designing the new column with purpose. Decide if it’s nullable, set the right data type, and choose defaults that won’t require extra writes. In PostgreSQL, adding a nullable column with a default can rewrite the table; in MySQL, it depends on storage format. Always check the size of the table before deciding on the migration path.
In production systems, use schema migrations that are backward-compatible. Deploy the column first, allow your code to start writing to it, then backfill data in small batches. Keep read and write logic tolerant of missing or null values until backfill completes.