The database table stopped growing. You had added all the indexes, tuned every query, and the next step was clear: add a new column.
A new column changes the shape of your data. It can store more attributes, track more states, enable new features, and open new queries. But it can also break migrations, slow writes, and lock tables if done wrong. Adding one in production requires thought, precision, and a path to rollback.
First, define the purpose. Avoid vague column names. Choose types that match your data source and access patterns. Integer for counts. Boolean for flags. Text for short strings. Use ENUMs cautiously—changing them later can be costly.
Second, plan the migration. On large datasets, adding a column with a default non-null value can cause full table rewrites. Consider null defaults, followed by backfills in controlled batches. If your database supports it, use ADD COLUMN … DEFAULT with NOT NULL only after the data is populated.