moved SQL to ratings to cronjobs