> For the complete documentation index, see [llms.txt](https://docs.snapfix.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.snapfix.com/engineering-reference/db/tables/viewpoint-10.md).

# Compliance tables

{% hint style="info" %}
Generated from the staging database schema, with descriptions drafted by agents ([how to read these docs](https://docs.snapfix.com/how-to-read.md)). [Source on GitHub](https://github.com/snapfix/docs/blob/main/spec/db/tables/viewpoint-10.md).
{% endhint %}

## Description

Snapfix Comply: system types, systems, contractors, documents, their links to assets, tasks, tags and users, and their logs.

## Tables

| Name                                                                                                                        | Columns | Comment                                                                                                                                                                                                                                                      | Type       |
| --------------------------------------------------------------------------------------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------- |
| [comply\_Contractor](https://docs.snapfix.com/engineering-reference/db/tables/comply_contractor.md)                         | 31      | One contractor of a site (uuid\_tParent), with contact details and an expiry date. Deleting sets fDeleted.                                                                                                                                                   | BASE TABLE |
| [comply\_ContractorAsset](https://docs.snapfix.com/engineering-reference/db/tables/comply_contractorasset.md)               | 12      | Links a compliance contractor (uuid\_Contractor) to an asset, which is a task row of an asset group (uuid\_tJob).                                                                                                                                            | BASE TABLE |
| [comply\_ContractorDocument](https://docs.snapfix.com/engineering-reference/db/tables/comply_contractordocument.md)         | 12      | Links a compliance contractor to a compliance document.                                                                                                                                                                                                      | BASE TABLE |
| [comply\_ContractorLog](https://docs.snapfix.com/engineering-reference/db/tables/comply_contractorlog.md)                   | 12      | Links a compliance contractor to one entry of comply\_Log.                                                                                                                                                                                                   | BASE TABLE |
| [comply\_ContractorTag](https://docs.snapfix.com/engineering-reference/db/tables/comply_contractortag.md)                   | 12      | A tag on a contractor. Unused; only its model and migration refer to it.                                                                                                                                                                                     | BASE TABLE |
| [comply\_ContractorUserAssigned](https://docs.snapfix.com/engineering-reference/db/tables/comply_contractoruserassigned.md) | 13      | One site user assigned to a compliance contractor; fUnassigned is 1 once the user is unassigned.                                                                                                                                                             | BASE TABLE |
| [comply\_Document](https://docs.snapfix.com/engineering-reference/db/tables/comply_document.md)                             | 19      | One compliance document of a site: a file under a document type (uuid\_DocumentType), with its file path, URL, optional expiry date and AI indexing state. Systems and contractors link to it through comply\_SystemDocument and comply\_ContractorDocument. | BASE TABLE |
| [comply\_DocumentType](https://docs.snapfix.com/engineering-reference/db/tables/comply_documenttype.md)                     | 12      | One document type of a site (uuid\_tParent), such as a certificate type, that compliance documents are filed under.                                                                                                                                          | BASE TABLE |
| [comply\_Log](https://docs.snapfix.com/engineering-reference/db/tables/comply_log.md)                                       | 15      | One entry of the compliance activity log, with its action, entity, text and request JSON. Systems and contractors link to entries through comply\_SystemLog and comply\_ContractorLog.                                                                       | BASE TABLE |
| [comply\_System](https://docs.snapfix.com/engineering-reference/db/tables/comply_system.md)                                 | 25      | One compliance system of a site, under a system type (uuid\_SystemType), with an expiry date and alert days. Deleting sets fDeleted and leaves its task links in tPri\_JobComplySystem.                                                                      | BASE TABLE |
| [comply\_SystemAsset](https://docs.snapfix.com/engineering-reference/db/tables/comply_systemasset.md)                       | 12      | Links a compliance system (uuid\_System) to an asset, which is a task row of an asset group (uuid\_tJob).                                                                                                                                                    | BASE TABLE |
| [comply\_SystemContractor](https://docs.snapfix.com/engineering-reference/db/tables/comply_systemcontractor.md)             | 12      | Links a compliance system to a compliance contractor.                                                                                                                                                                                                        | BASE TABLE |
| [comply\_SystemDocument](https://docs.snapfix.com/engineering-reference/db/tables/comply_systemdocument.md)                 | 12      | Links a compliance system to a compliance document.                                                                                                                                                                                                          | BASE TABLE |
| [comply\_SystemLog](https://docs.snapfix.com/engineering-reference/db/tables/comply_systemlog.md)                           | 12      | Links a compliance system to one entry of comply\_Log.                                                                                                                                                                                                       | BASE TABLE |
| [comply\_SystemTag](https://docs.snapfix.com/engineering-reference/db/tables/comply_systemtag.md)                           | 12      | A tag on a compliance system. Unused; only its model and migration refer to it.                                                                                                                                                                              | BASE TABLE |
| [comply\_SystemType](https://docs.snapfix.com/engineering-reference/db/tables/comply_systemtype.md)                         | 13      | One compliance system type of a site (uuid\_tParent), such as a fire alarm type, with a name and sort order; compliance systems sit under it.                                                                                                                | BASE TABLE |
| [comply\_SystemUserAssigned](https://docs.snapfix.com/engineering-reference/db/tables/comply_systemuserassigned.md)         | 13      | One site user assigned to a compliance system; fUnassigned is 1 once the user is unassigned.                                                                                                                                                                 | BASE TABLE |
| [comply\_enumFrequency](https://docs.snapfix.com/engineering-reference/db/tables/comply_enumfrequency.md)                   | 11      | A frequency name, from seven seed rows (Daily to Annually). Unused; GET /v1/app/frequencies returns the fixed FrequencyType list instead, and the two functions that read this table are never called.                                                       | BASE TABLE |
| [tPri\_JobComplySystem](https://docs.snapfix.com/engineering-reference/db/tables/tpri_jobcomplysystem.md)                   | 12      | Links a task to a compliance system (comply\_System).                                                                                                                                                                                                        | BASE TABLE |

## Relations

```mermaid
erDiagram

"comply_Contractor" }o--o| "comply_enumFrequency" : "FOREIGN KEY (uuid_enumFrequency) REFERENCES comply_enumFrequency (uuid)"
"comply_ContractorAsset" }o--o| "comply_Contractor" : "FOREIGN KEY (uuid_Contractor) REFERENCES comply_Contractor (uuid)"
"comply_ContractorDocument" }o--o| "comply_Contractor" : "FOREIGN KEY (uuid_Contractor) REFERENCES comply_Contractor (uuid)"
"comply_ContractorDocument" }o--o| "comply_Document" : "FOREIGN KEY (uuid_Document) REFERENCES comply_Document (uuid)"
"comply_ContractorLog" }o--o| "comply_Contractor" : "FOREIGN KEY (uuid_Contractor) REFERENCES comply_Contractor (uuid)"
"comply_ContractorLog" }o--o| "comply_Log" : "FOREIGN KEY (uuid_Log) REFERENCES comply_Log (uuid)"
"comply_ContractorTag" }o--o| "comply_Contractor" : "FOREIGN KEY (uuid_Contractor) REFERENCES comply_Contractor (uuid)"
"comply_ContractorUserAssigned" }o--o| "comply_Contractor" : "FOREIGN KEY (uuid_Contractor) REFERENCES comply_Contractor (uuid)"
"comply_Document" }o--o| "comply_DocumentType" : "FOREIGN KEY (uuid_DocumentType) REFERENCES comply_DocumentType (uuid)"
"comply_System" }o--o| "comply_enumFrequency" : "FOREIGN KEY (uuid_enumFrequency) REFERENCES comply_enumFrequency (uuid)"
"comply_System" }o--o| "comply_SystemType" : "FOREIGN KEY (uuid_SystemType) REFERENCES comply_SystemType (uuid)"
"comply_SystemAsset" }o--o| "comply_System" : "FOREIGN KEY (uuid_System) REFERENCES comply_System (uuid)"
"comply_SystemContractor" }o--o| "comply_Contractor" : "FOREIGN KEY (uuid_Contractor) REFERENCES comply_Contractor (uuid)"
"comply_SystemContractor" }o--o| "comply_System" : "FOREIGN KEY (uuid_System) REFERENCES comply_System (uuid)"
"comply_SystemDocument" }o--o| "comply_Document" : "FOREIGN KEY (uuid_Document) REFERENCES comply_Document (uuid)"
"comply_SystemDocument" }o--o| "comply_System" : "FOREIGN KEY (uuid_System) REFERENCES comply_System (uuid)"
"comply_SystemLog" }o--o| "comply_Log" : "FOREIGN KEY (uuid_Log) REFERENCES comply_Log (uuid)"
"comply_SystemLog" }o--o| "comply_System" : "FOREIGN KEY (uuid_System) REFERENCES comply_System (uuid)"
"comply_SystemTag" }o--o| "comply_System" : "FOREIGN KEY (uuid_System) REFERENCES comply_System (uuid)"
"comply_SystemUserAssigned" }o--o| "comply_System" : "FOREIGN KEY (uuid_System) REFERENCES comply_System (uuid)"
"tPri_JobComplySystem" }o--o| "comply_System" : "FOREIGN KEY (uuid_System) REFERENCES comply_System (uuid)"

"comply_Contractor" {
  varchar_255_ uuid
  varchar_255_ uuid_enumFrequency
}
"comply_ContractorAsset" {
  varchar_255_ uuid_Contractor
}
"comply_ContractorDocument" {
  varchar_255_ uuid_Contractor
  varchar_255_ uuid_Document
}
"comply_ContractorLog" {
  varchar_255_ uuid_Contractor
  varchar_255_ uuid_Log
}
"comply_ContractorTag" {
  varchar_255_ uuid_Contractor
}
"comply_ContractorUserAssigned" {
  varchar_255_ uuid_Contractor
}
"comply_Document" {
  varchar_255_ uuid
  varchar_255_ uuid_DocumentType
}
"comply_DocumentType" {
  varchar_255_ uuid
}
"comply_Log" {
  varchar_255_ uuid
}
"comply_System" {
  varchar_255_ uuid
  varchar_255_ uuid_SystemType
  varchar_255_ uuid_enumFrequency
}
"comply_SystemAsset" {
  varchar_255_ uuid_System
}
"comply_SystemContractor" {
  varchar_255_ uuid_System
  varchar_255_ uuid_Contractor
}
"comply_SystemDocument" {
  varchar_255_ uuid_System
  varchar_255_ uuid_Document
}
"comply_SystemLog" {
  varchar_255_ uuid_System
  varchar_255_ uuid_Log
}
"comply_SystemTag" {
  varchar_255_ uuid_System
}
"comply_SystemType" {
  varchar_255_ uuid
}
"comply_SystemUserAssigned" {
  varchar_255_ uuid_System
}
"comply_enumFrequency" {
  varchar_255_ uuid
}
"tPri_JobComplySystem" {
  varchar_255_ uuid_System
}
```

***

> Generated by [tbls](https://github.com/k1LoW/tbls)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.snapfix.com/engineering-reference/db/tables/viewpoint-10.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
