Improve the database init logic to catch missing tables data corruption