Why are records not really deleted in the database?

9 years ago
The SQL scripts that come with the NOP Commerce files you download. There are I think 2 scripts for 1.90 Just perform a search for *.sql in the directory where you expanded the zip file.

"Drop table" is what you actually do to an object within a database. That is the command you type in the query pane.

DROP TABLE <TableName>

Just beware, there are some tables that you will want to keep. You can also look at the Database Diagram to see what tables have an integrity reference, or you can query the system table to see all the names of all the references.

I am a SQL Database Architect and Administrator, that is why my post sounds "DBA" ish.

Andrew SQLDBA
8 years ago
So to delete them permanently, you must force them to sql server?
and this also to reorganize the indexes?
8 years ago
Force what to SQL Server? That statement does not make any sense.

If you drop a table, all objects in and associated with that table are also deleted. No table, no index.

Andrew SQLDBA
7 years ago
IMHO, I think this is not a robust way to handle data integrity.
Secondly, I forces the system to always exclude records which are marked deleted.
I suspect that the search engine does not take this into account when you delete ProductVariants!
7 years ago
rinusripsus wrote:
IMHO, I think this is not a robust way to handle data integrity.
Secondly, I forces the system to always exclude records which are marked deleted.
I suspect that the search engine does not take this into account when you delete ProductVariants!


Your suspicions are incorrect re search engines.

HTH

Dave
7 years ago
Hi daveb,

My experience with handling integrity with deleted fields, told me to be suspicious and this suspicion is correct.
See thread https://www.nopcommerce.com/boards/t/19021/search-also-looks-in-deleted-productvariants.aspx
When you start joining, you always have to be carfull.

Regards,
Reinout
7 years ago
It's because of the relations. For example you can't delete a productvariant because it has a relation with OrderProductVariant (which is related to Order, and we don't want to throw away orders).

Edit: Though I agree, for performance and simplicity we should really delete products (and if we need the data for historical reference we should duplicate that data)
7 years ago
Keesjan, I know the reason, that's not the problem. And I understand the nature to choose this design approach.
But there is always the danger to forget to 100% exclude 'false' results.
7 years ago
your edit says it all!
7 years ago
rinusripsus wrote:
Hi daveb,

My experience with handling integrity with deleted fields, told me to be suspicious and this suspicion is correct.
See thread https://www.nopcommerce.com/boards/t/19021/search-also-looks-in-deleted-productvariants.aspx
When you start joining, you always have to be carfull.

Regards,
Reinout


You should have actually ran a test first. It's fine.