The database was ready, but the schema wasn’t. You needed a new column, and nothing else mattered until it was there.
Adding a new column in production should be simple. It rarely is. Tables carry millions of rows. Queries run nonstop. Downtime is not an option. The wrong migration strategy can block writes, lock the table, or bring the application down.
The safest path starts with understanding your database engine. In MySQL, ALTER TABLE can lock the table by default. Use ALGORITHM=INPLACE where possible to avoid full table copies. In PostgreSQL, adding a nullable column with a default is instant in modern versions, but setting a non-null constraint on large tables still needs careful planning.
Always test migrations in a staging environment with data volumes close to production. Use feature flags to control when the new column starts being read or written. Deploy in small steps: