Automatic error logging into tables + modified db schema