Project

General

Profile

Collection version history » History » Version 6

Peter Amstutz, 07/11/2018 04:28 PM

1 1 Tom Clegg
h1. Collection version history
2
3
(draft)
4
5 6 Peter Amstutz
Background: desired API features (see #13109, #13494, #13561)
6 1 Tom Clegg
* Get current + previous versions of a collection with a single API call
7
* Search all current + previous versions of collections with a single API call
8
* Stable small numeric "version number" for each version of a given collection
9
10 2 Tom Clegg
Implementation
11 1 Tom Clegg
* Store all versions in the collection table (much easier to do paging)
12 2 Tom Clegg
* New database column indicates current version's UUID
13
* New database column indicates user-friendly version number (starting at 1) -- can be assigned safely after locking "current" row for update
14 3 Tom Clegg
* Assign version number to the current version -- this way {uuid,version} can be used as a permanent reference to a specific version
15 5 Peter Amstutz
* Flag "include_past_versions" for "list" API to include old versions (otherwise, filter on current_version_uuid=uuid -- might need to adjust indexes to maintain performance)
16 2 Tom Clegg
* Flag in site configuration to enable preserving old versions in database
17 1 Tom Clegg
* Update owner_uuid of all old versions when it changes in the current version
18 5 Peter Amstutz
* A permission link to the current version implies permission to its entire history
19
* Prohibit permission links to old versions (should be handled by check "can only make links to things that are visible to you", and not including old versions)
20
* Old versions may not be modified except for certain fields which must be synchronized with "current" version changes (owner_uuid, trash_at, delete_at), updating owner_uuid, trash_at, delete_at does not update modified_at (???) so modified_at shows when the version was created
21
* Old versions with duplicate "name" does not conflict with (owner_uuid, name) uniqueness constraint
22
* The following changes introduce a new version: manifest_text, description (??), properties (??)