Collection version history » History » Version 11
Tom Morris, 09/06/2018 01:50 PM
Add some design alternatives from discussion today
1 | 1 | Tom Clegg | h1. Collection version history |
---|---|---|---|
2 | |||
3 | (draft) |
||
4 | |||
5 | 7 | Peter Amstutz | Background: desired API features (#13494, #13561) epic ticket is #13109 |
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 | 8 | Peter Amstutz | h2. Design |
11 | |||
12 | 1 | Tom Clegg | * Store all versions in the collection table (much easier to do paging) |
13 | 7 | Peter Amstutz | * New database column "current_version_uuid" for latest version this the same as "uuid" |
14 | 2 | Tom Clegg | * New database column indicates user-friendly version number (starting at 1) -- can be assigned safely after locking "current" row for update |
15 | 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 |
16 | 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) |
17 | 1 | Tom Clegg | * Flag in site configuration to enable preserving old versions in database |
18 | 7 | Peter Amstutz | * Update owner_uuid of all old versions (in a transaction) when it changes in the current version |
19 | 8 | Peter Amstutz | * A permission link to the current version only implies permission to the most recent version (not the history) |
20 | 1 | Tom Clegg | * Prohibit permission links to old versions (should be handled by check "can only make links to things that are visible to you", which should not include old versions) |
21 | * 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 |
||
22 | * Old versions with duplicate "name" does not conflict with (owner_uuid, name) uniqueness constraint |
||
23 | 8 | Peter Amstutz | * The following changes introduce a new version: manifest_text (portable_data_hash), description, properties, name, |
24 | * The following changes do not introduce a new version, and a copied to all past version records: replication_*, storage_classes_*, trash_at/delete_at/is_trashed, owner_uuid, uuid (update current_uuid to retain database consistency) |
||
25 | 11 | Tom Morris | |
26 | New proposal: |
||
27 | * Add a checkpoint_at field to the record which suspends creation of new versions on updates until the given datetime. This checkpoint_at can be updated and moved forward incrementally if desired. |
||
28 | * Alternative: have this be a system-wide config parameter |
||
29 | * Have an API ability to explicitly create versions when desired |