Adding a new column sounds simple. In practice, it can break deploys, corrupt data, or lock rows under load. Databases do not forgive sloppy migrations. The right approach depends on the engine, the data size, and the uptime requirements.
First, inspect the schema. Verify the current table definition and constraints. Do not assume it matches the docs. In MySQL or PostgreSQL, run DESCRIBE or query information_schema.columns to confirm the exact state before applying changes.
Second, define the new column with precision. Use the smallest data type that fits the need. If it will store only boolean flags, do not give it a full integer. If it must be indexed, plan the index creation to avoid full table locks.
When adding a new column to a large table, zero-downtime migration is key. Use ALTER TABLE with care. In PostgreSQL, most ADD COLUMN operations are fast if they include no default and are nullable. In MySQL, consider pt-online-schema-change or native ALGORITHM=INPLACE to prevent blocking.