The data needed more space. You had to add a new column.
In databases, a new column is not just extra storage. It changes schema, queries, and performance. Whether you work with PostgreSQL, MySQL, or SQLite, adding a column must be precise. Small errors can break production or corrupt data.
Before altering a table, know its size, indexes, and constraints. On large datasets, the operation can lock writes or even reads. Minimize downtime by scheduling the change during low-traffic windows. Test the exact ALTER TABLE statement in a staging environment. For example:
ALTER TABLE users ADD COLUMN last_login TIMESTAMP;
Choose the column type with intent. Mismatched data types slow queries and increase storage. Use NOT NULL with defaults when every row should have a value. If the column is optional, allow NULL explicitly.