Updated database to validate only, and sorted SQL logging.