7.3 .Stat Core transfer of deleted data between dataspaces
As Anastassia,
I want to be able to replicate a delete action of data from one space to another, as part of the transfer action,
So that I do not have to clean up the complete DSD in order to properly delete observations (and don't have them appearing as null observations in data extractions).
The transfer should automatically also transfer the information about any deleted data of the dataflow, and delete the corresponding observations in the target database. It must however respect the data filter parameter if that is provided. Deletions should be executed before the data updates/inserts.
-
Validate that the user has the proper rights (canUpdate, canImport, canDelete) in the destination dataspace, depending on the transfered data. - Check BEFORE transferring the data:
- the user has canRead data rights for the source dataspace
- AND the user has canInsert, canUpdate OR canDelete data rights for the target dataspace
- Stop if this is not the case.
- Check once the stream to the destination staging table is finished and before the merge of the values:
- if there are data to be updated/inserted: the user has canInsert OR canUpdate data rights for the target dataspace
- if there are data to be deleted: the user has canDelete data rights for the target dataspace
- Stop if this is not the case.
- Check BEFORE transferring the data:
Technical Notes
MS SQL Server now provides an in-built time machine through "temporal tables":
See: https://docs.microsoft.com/en-us/sql/relational-databases/tables/temporal-tables?view=sql-server-ver15
This out-of-the-box feature allows managing deleted data states. It's supposed to be implemented in #127 (closed).