Adding a new column is simple in theory, but in production it can break everything if done carelessly. The database schema shifts. Migrations run. The code must match the new structure before the first request hits. Safe deployment depends on planning each step.
First, define the new column with the correct type and default. Match it to the data you expect, not the data you have now. Small mistakes here—wrong nullability, wrong length—become hard constraints later.
Next, run migrations in a controlled way. On large tables, locking writes may cause downtime. Use tools that support online schema changes. In PostgreSQL, adding a nullable column with no default is fast. In MySQL, the approach depends on engine and version. Always test in staging with real data volumes.
After schema change, update the application code. Check model definitions, DTOs, and serializers. Update API docs and contracts. Deploy code that can handle both the old and new schemas during the transition. Avoid schema-coupled code between migrations and deploys.