feat(database): add validate sql functions to migrate to new database (refs #2761)