Changes

HowTo:Hard delete database records

1,323 bytes added, 11 April
Created page with "Since {{UBIK}} 4.3, it is possible to hard-delete records from the database to avoid it growing endlessly. <!-- DO NOT REMOVE THIS -->{{Template:HowTo/Begin}}<!-- DO NOT REMO..."
Since {{UBIK}} 4.3, it is possible to hard-delete records from the database to avoid it growing endlessly.
<!-- DO NOT REMOVE THIS -->{{Template:HowTo/Begin}}<!-- DO NOT REMOVE THIS -->

= Instructions =
<!-- DO NOT MODIFY THE NAME OF THIS SECTION, BUT REMOVE IT IF NOT REQUIRED -->

# Delete objects regularly.
# Perform a hard-delete operation.

The hard-delete operation is available for programmatic customizing or execution via Who-Bert on the server side.
A set of methods for hard-deleting objects from the database is now available in the IDataFactory interface:
<source lang="csharp">
bool HardDeleteRecords(MetaClass mc, DateTime? markedBefore = null);
bool HardDeleteRecords(MetaClass mc, List<Guid> idsToDelete);
</source>
E.g.:
<source lang="csharp">
environment.UBIKDataFactory().HardDeleteRecords(metaclass);
</source>

The overloads of the hard-delete method allow for removal of records that were marked as deleted before a given date, or from a range of specific IDs (again, of already deleted objects).

<!-- ==See also== -->
<!-- DO NOT MODIFY THE NAME OF THIS SECTION, BUT REMOVE IT IF NOT REQUIRED -->

[[Category:How-To|Hard delete database records]]
[[Category:Coding|Hard delete database records]]
[[Category:Database|Hard delete database records]]
[[Category:Studio|Hard delete database records]]
1,765
edits