The error log was clean until the schema change hit the users table and failed to add the new column.
Adding a new column should be simple. In reality, it can stall deployments, lock tables, and cause downtime if not planned. Whether in PostgreSQL, MySQL, or modern cloud-native databases, the cost lies in how the engine rewrites data and updates indexes.
Before adding a new column, define its data type with precision. Avoid TEXT or overly generic types unless necessary — they can bloat storage and slow queries. If the column will store non-null values, decide if a default value is needed. Adding a default on large tables can trigger a full table rewrite in some engines.
In PostgreSQL, ALTER TABLE ADD COLUMN is fast if no default or constraint is applied. For MySQL, behavior depends on the engine type: InnoDB may rebuild the table even without indexes. On massive datasets, consider rolling out schema changes with tools like pt-online-schema-change or gh-ost.