Importing Deleted Posts

It seems that most importers exclude pulling over posts that have been deleted in the source software, but I’d like to preserve these. However, I want to make sure they are properly deleted in Discourse when imported. Setting deleted_at and deleted_by_id doesn’t seem to be working:

if m['state'] == "deleted"
  mapped[:deleted_at] = Time.now
  mapped[:deleted_by_id] = -1
end

This does work if I just set the :hidden attribute, but I don’t really want these posts visible to most users. Is it possible to set a post as deleted during creation or is this something that will require coming back after the import batch and setting via a separate call or query?