Sites table

The Sites table in the FitStack - V2 schema has 15 columns, keyed by Id. 5 columns in Companies, SiteVersions and SiteDomains reference it.

Columns (15)

Columns of the Sites table
ColumnTypeConstraintsDescription
Iduuidprimary key, not null
CompanyIduuidnot nullONE Site per Company (ADR 0011).
Subdomaincharacter varying(63)not nullDNS label under the FitStack Gym sites domain; defaults to the Company slug.
Statustextnot null`SiteStatus`.
TemplateKeycharacter varying(50)not nullWhich starting layout the Site was generated from.
ThemeJsonjsonbnot null{colors:{primary,…}, fonts:{heading,body}, logoMediaId, radius}. Validated against the renderer's theme schema.
PublishedVersionIduuidThe version visitors see. Null while Draft/Unpublished.
DraftVersionIduuidThe version Employees are editing. Saving writes here; Publish copies it to a new immutable version and moves PublishedVersionId.
DraftPreviewTokentextnot nullOpaque; the Astro app renders the draft when ?preview=<token> matches. Rotated on Publish.
SeoTitlecharacter varying(120)
SeoDescriptioncharacter varying(320)
CreatedAttimestamp with time zonenot null
ModifiedAttimestamp with time zone
IsDeletedbooleannot null
DeletedAttimestamp with time zone

Indexes (3)

  • (CompanyId) unique (IX_Sites_CompanyId)
  • (Subdomain) unique (IX_Sites_Subdomain)
  • (DraftPreviewToken) unique (IX_Sites_DraftPreviewToken)

Relationships