Why are records not really deleted in the database?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
11 năm cách đây
no use arguing if you start blaming for not testing (which I have)
11 năm cách đây
Perhaps a compromise would be a routine that deletes marked fields after a certain amount of time.  That time would be designated by the admin (possibly make it an option that can be turned off to maintain data forever and ever).  Yes, data integrity would be compromised afterwards, however, if they backed up their orders ahead of time to pdf or excel, that would give reference.  Just a thought going forward maybe.
9 năm cách đây
If you want to delete a product from Product table permantely, add this line to :


\Libraries\Nop.Services\Catalog\ProductService.cs


        public virtual void DeleteProduct(Product product)
        {
            if (product == null)
                throw new ArgumentNullException("product");
            
            //delete product
            product.Deleted = true;            
            UpdateProduct(product);

            // ADD THIS LINE BELOW  (permanately deletes the product) :
            _productRepository.Delete(product);            
        }
9 năm cách đây
MikeMCSD wrote:
If you want to delete a product from Product table permantely, add this line to :


\Libraries\Nop.Services\Catalog\ProductService.cs


        public virtual void DeleteProduct(Product product)
        {
            if (product == null)
                throw new ArgumentNullException("product");
            
            //delete product
            product.Deleted = true;            
            UpdateProduct(product);

            // ADD THIS LINE BELOW  (permanately deletes the product) :
            _productRepository.Delete(product);            
        }


Will this delete associated records as well or will it leave orphaned data that might cause issues?

Thanks.
7 năm cách đây
It will only delete product record in one table. Else associated data like images, store mapping will still be in database.
5 năm cách đây
Hello,

We have made a plugin to do this https://www.nopcommerce.com/p/3241/plugin-to-recover-deleted-products-in-nopcommerce-by-nopadvance.aspx
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.