cweiske/SemanticScuttle — pull request #8 by pascalfree (2014-05-17 11:44:13+00:00)
Title: Fix: Detect deletion of bookmark via api/posts_update.php

Hi.

This is the fix I have had announced [here](https://github.com/cweiske/SemanticScuttle/pull/7) and it does the following:
1. Whenever a Bookmark is deleted, store the datetime of deletion in the database
2. In `api/posts_update.php`, use the date of the most recently modified bookmark (still existing) or the last deletion date, whichever happened more recently.

Additionally I changed the default behaviour of the `api/posts_update.php` to return the last modification time instead of creation time, because [delicious fixed this as well](https://github.com/SciDevs/delicious-api/issues/16). I left the option to get the created time using `?datemode=created` but I think that could be removed entirely.

The fix needs an upgrade of the database. I wrote the SQL queries in the files in `data/upgrade` (I did not test the postgresql version!). However I was not sure on how to perform the upgrade. I found [`www/upgrade.php`](https://github.com/pascalfree/SemanticScuttle/blob/master/www/upgrade.php) which was used for previous upgrades, but I though I'd ask you first how you would prefer to perform this upgrade.

Additionally, I think it may be a good idea to have an api function, that returns the version of semantic scuttle (or maybe even return it in `api/posts_update.php`). This can then be used by clients to determine, if e.g. deletions are detectable and take action to account for that.