← all rules

drop-column

warning

DROP COLUMN

Why it's unsafe

DROP COLUMN breaks any application code still selecting or writing the column the moment it runs — and the data is gone.

Safe rewrite

Ship the code that stops using the column first; drop it in a later migration once nothing references it. Consider a two-phase deploy.

Example

Try it in the playground →

Unsafe

ALTER TABLE users DROP COLUMN legacy_flag;

Related