I asked Postgres to turn a 0/1 integer flag into a boolean. It refused, and my USING clause was correct.
The column still had DEFAULT 1. PostgreSQL converts the default on its own, without your USING expression, and an integer default has no way to become a boolean. Hence "default for column cannot be cast automatically".
The fix: drop the default, change the type, then SET DEFAULT true.
The awkward part: while testing this, I found Schemity's own migration planner made the same mistake. It drops the default first since v2.12.2.
What's the Postgres error that cost you the most time for the least reason?
commit d28d40a
