Reputation: 136
How do I delete a single record from the local store on multiple phones? The initiating phone correctly deletes the record from its local store (sqlite) and Azure (SQL Server).
However, I incorrectly assumed that other phones would delete the record from their local store after performing a pull, they don’t. Instead the ‘should be’ deleted record becomes orphaned until its entire table is purged and then pulled. This seems like overkill to delete a single record. How do I easily delete local store records between multiple devices?
Upvotes: 0
Views: 82
Reputation: 8035
Use 'soft-delete' on the server.
In a node-based server, set table.softDelete = true;
in the table definition.
In an ASP.NET based server, set enableSoftDelete: true
in the constructor of the EntityDomainManager.
This adds a Deleted column to the model. When the client pulls, any records that are marked deleted will be pulled down as well, and the client will delete the records from the SQLite store. When a record is deleted on the client, it is marked deleted instead.
On the server, you will need to clean up the marked-deleted records on a regular basis.
Upvotes: 2