Moving from storing apikey_id to application_id on occurrences