Project

General

Profile

Actions

Collection version history » History » Revision 7

« Previous | Revision 7/17 (diff) | Next »
Peter Amstutz, 08/01/2018 05:37 PM


Collection version history

(draft)

Background: desired API features (#13494, #13561) epic ticket is #13109
  • Get current + previous versions of a collection with a single API call
  • Search all current + previous versions of collections with a single API call
  • Stable small numeric "version number" for each version of a given collection
Implementation
  • Store all versions in the collection table (much easier to do paging)
  • New database column "current_version_uuid" for latest version this the same as "uuid"
  • New database column indicates user-friendly version number (starting at 1) -- can be assigned safely after locking "current" row for update
  • Assign version number to the current version -- this way {uuid,version} can be used as a permanent reference to a specific version
  • 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)
  • Flag in site configuration to enable preserving old versions in database
  • Update owner_uuid of all old versions (in a transaction) when it changes in the current version
  • A permission link to the current version implies permission to its entire history
  • 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)
  • 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
  • Old versions with duplicate "name" does not conflict with (owner_uuid, name) uniqueness constraint
  • The following changes introduce a new version: manifest_text, description, properties.

Questions:

  • Should any other field changes introduce a new version, such as changing "name"
  • Are desired_replication_count and desired_storage_class separate for each version? Feature to automatically put old versions into a certain storage class?

Updated by Peter Amstutz over 5 years ago · 7 revisions