SiteVersions table

The SiteVersions table in the FitStack - V2 schema has 9 columns, keyed by Id, with 3 foreign keys to Sites and Employees.

Version history for rollback. No soft delete: versions are kept.

Columns (9)

Columns of the SiteVersions table
ColumnTypeConstraintsDescription
Iduuidprimary key, not null, references Sites.DraftVersionId
SiteIduuidnot null, references Sites.IdCASCADE.
Numberintegernot nullMonotonic per Site.
PagesJsonjsonbnot nullThe block tree: { pages: [ { key, path, title, blocks: [ { id, type, props, children? } ] } ] } Location pages for each Gym are generated into this tree at save time so the renderer never needs the Gym tables; dynamic data (timetable, offers, products, trainers) is referenced by id in block props and resolved by the public read endpoint.
IsImmutablebooleannot nullTrue once published or superseded; only the current draft version is mutable.
CreatedByEmployeeIduuidreferences Employees.Id
PublishedAttimestamp with time zoneSet when this version became the published one.
CreatedAttimestamp with time zonenot null
ModifiedAttimestamp with time zone

Indexes (1)

  • (SiteId, Number) unique (IX_SiteVersions_SiteId_Number)

Relationships