There is, presumably, already code which checks the validity/consistency of the schema which is used following/before ALTER TABLE commands. If this were a separate function (internally) then perhaps it could be exposed via a PRAGMA? As in `pragma check_schema` which returns `OK` if the schema passes consistency checks, otherwise it throws an error for whatever the first thing is it finds wrong (ie, a view references a non-existing table/column/etc). While this might not solve the entire problem it could, however, give an indication that the schema is at least internally consistent. Just an idea.