Implement database purge