Versioning Contents
How to manage different versions of a same content (core versioning and language versioning)
Note:
Contents can be versioned in 2 ways: pure versioning to allow working on different versions of the same content and language versioning to allow to work on 2 different translations of the same content. To clarify:
- the word "version" or "core version" is used to talk about a version of a content
- the word "language" or "language version" is used to talk about a translation of a content
Needs and Requirements:
- ensure BC with CMS API
- contents can be translated in several languages (this is I18N), each language being versioned too
- contents can have multiple versions, only one can be marked as current for each language
- each version can have a status (deleted, draft/being edited, for approval, approved, published, archived)
Versioning Process
When we create a new content a first version is automatically created. Saving the content will preserve the same version number. When we want to work on a new version, we should duplicate the current version of the content and save it as the n+1 version. For a content to be available on frontend it should be published (status) and marked as current (is_current).
Proposed DB Design
content_version table
| Name | Definition |
| content_version_id | int(11) NOT NULL |
| content_id | int(11) NOT NULL |
| version | smallint(6) NOT NULL default('1') |
| is_current | tinyint(1) NOT NULL default('0') |
| language_id | smallint(6) NOT NULL |
| status | smallint(6) NOT NULL |
| created_by | int(11) NOT NULL |
| date_created | datetime NOT NULL |
| updated_by | int(11) NOT NULL |
| last_updated | datetime NOT NULL |
content table
| Name | Definition |
| content_id | int(11) NOT NULL |
| created_by | int(11) NOT NULL |
| date_created | datetime NOT NULL |
| updated_by | int(11) NOT NULL |
| last_updated | datetime NOT NULL |
attribute_data table
| Name | Definition |
| attribute_data_id | int(11) NOT NULL |
| content_version_id | int(11) NOT NULL |
| attribute_id | int(11) NOT NULL |
| value | text NULL |
