I get an error about the NOT NULL constraint being violated on table
users. Appearantly the migration tries to put NULL in the added column
for all existing rows.
One would wish :default => false would solve this problem. However, it
doesn’t have any effect - the migration statement emits the exact same
error with or without :default => false.
One would wish :default => false would solve this problem. However, it
doesn’t have any effect - the migration statement emits the exact same
error with or without :default => false.
In PostgreSQL, even without Rails migrations (pure SQL or use PgAdmin
III), if you try to add a column with NOT NULL and set default to
FALSE, you still get the same error. The workaround is to: