Schema changes are small in code, but massive in consequence. A single new column can speed up a core feature, unlock reporting, or break a release if mishandled.
When adding a new column, precision matters. First, define the exact data type. For integers, choose the smallest type that fits your range. For strings, define limits to avoid uncontrolled growth. Set sensible defaults when the value is predictable, but leave it nullable if historical rows cannot be backfilled reliably.
Run migrations in a controlled way. In production, large tables mean writes can block for seconds or minutes. Use online schema migration tools or phased rollouts to avoid locking. For PostgreSQL, ADD COLUMN without a default is fast, while adding one with a default rewrites the table. In MySQL, check whether the storage engine will rebuild the entire table for your change.
Indexing a new column should not be automatic. Measure query patterns before adding an index to avoid degraded writes. If you need the index, create it in a separate migration from the column addition to minimize deploy risk.