WP Document Revisions

WP-Documents-Revisions Data Design and Data Structure

Requirements

Data Structure

The records held in the database will be:

  1. Document Record
  1. Attachment Record(s)

There can be multiple Attachment records, one for each Document file loaded.

  1. Revision Record(s)

When saving a Document Record, standard WP processing will be invoked to detect a change in title, content or excerpt fields. If one is found then a Revision record is created.

There can be multiple Revision records held, one for each saving event where a change in these fields are detected.

Because the document content contains the latest Attachment ID, an upload of a revised Document file will create a new document Revision record.