The migration was live. The database waited for its next move. A single decision would change the schema: add a new column.
Adding a new column is not just an update; it is a direct change to the shape of your data. Whether you work with PostgreSQL, MySQL, or modern cloud databases, the process must be precise. A mistake can lock tables, cause downtime, or lead to silent data loss.
First, define the purpose. Is the new column storing raw input, computed results, or metadata? Choose the correct data type. Consider constraints: NOT NULL, default values, and whether the field must be unique. Columns are more than placeholders. They enforce rules.
Second, decide how to deploy. Online schema changes reduce downtime. Tools like ALTER TABLE in PostgreSQL are fast for small datasets but risky at scale. For massive tables, use phased migrations: