The migration failed at 02:14. Logs showed nothing except one line: ERROR: column "status"does not exist.
Adding a new column should be simple. In SQL, the core command is ALTER TABLE table_name ADD COLUMN column_name data_type;. But in real systems, it’s never just that. Schema changes cascade. They hit ORM models, API contracts, test suites, and deployment pipelines. A new column in Postgres or MySQL must be handled with care to avoid downtime or inconsistent data.
The first step is defining the exact schema change. Decide the data type, default value, and nullability. Think about indexing. Adding an index on a new column speeds queries but increases write cost. If you are adding a boolean or enum, keep it as small as possible for storage and performance.
Next, plan the deployment sequence. Avoid locking the table in production if traffic is high. In Postgres, adding a new column without a default is instant. Setting a default on creation rewrites the table. Safer to add the column first, then update defaults in a second step. In MySQL, operations may require ALGORITHM=INPLACE or LOCK=NONE to avoid blocking queries.