Fixed migration scripts to handle if tables do not exist.