The migration ran clean until the schema diff revealed it: you need a new column. No drama, no debates—just the fact. The table must change, and it must change now.
Adding a new column seems simple, but the wrong move can block writes, lock tables, or break production code. In high-load systems, schema changes must be deliberate. You plan the column definition, data type, nullability, and default values before touching the ALTER statement.
First, verify usage paths. Check ORM models, direct SQL queries, and analytics pipelines. Any missing update will cause runtime errors or incomplete data ingestion. A new column in Postgres, MySQL, or any relational database carries implicit dependencies. Even if the name is right, the placement in SELECT * queries can shift output and break fragile integrations.
Second, decide on the migration strategy. For large tables, online schema change tools like pt-online-schema-change or gh-ost can add a column without blocking. Smaller datasets may allow direct ALTER TABLE operations. Measure migrations in staging with representative data volume before merging to main.