SQLite Forum

alter table "table" add column "name" varchar not null throws Cannot add a NOT NULL column with default value NULL
Login
Basically ALTER TABLE doesn't distinguish between if it's running on an empty table vs. a table with records.

If there were any records they would all get the default of NULL while you're declaring it to be NOT NULL. And so it says "nope, can't do it" without checking if the table is empty and it would be ok.