some db bug fixes, such as removing deleted products in purchase history