Ensure unique index on event ID

This should prevent duplicate events in the database.