> 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-9.md).

# Assets 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-9.md).
{% endhint %}

## Description

Asset registers and their categories, attributes and attribute rules, and the links between tasks and assets.

## Tables

| Name                                                                                                                        | Columns | Comment                                                                                                                                                                                                                                                                                                                                                                                                     | Type       |
| --------------------------------------------------------------------------------------------------------------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
| [assetAttribute](https://docs.snapfix.com/engineering-reference/db/tables/assetattribute.md)                                | 19      | Legacy: one attribute value (atKey, atValue) of an asset in the old asset model (uuid\_assetMain). No row was added or changed after November 2022, but php-apis still reads it. Today's asset attributes are in tPri\_JobAttribute.                                                                                                                                                                        | BASE TABLE |
| [assetMain](https://docs.snapfix.com/engineering-reference/db/tables/assetmain.md)                                          | 15      | Legacy: one asset of an old asset register (uuid\_assetReg), with its name and sort order. No row was added or changed after November 2022, but apipy's task detail reads asset names through tPri\_JobAsset, php-apis reads it and the iOS sync downloads it. Today's assets are task rows in asset groups.                                                                                                | BASE TABLE |
| [assetParentCatKey](https://docs.snapfix.com/engineering-reference/db/tables/assetparentcatkey.md)                          | 20      | Legacy: one site-level attribute rule for the old asset registers (key, category, unique and mandatory flags); 24 rows, none added or changed after November 2022. Only php-apis names it, and it still serves the old asset picker.                                                                                                                                                                        | BASE TABLE |
| [assetReg](https://docs.snapfix.com/engineering-reference/db/tables/assetreg.md)                                            | 17      | Legacy: one asset register of a site in the old asset model, with its name, address and image. No row was added or changed after November 2022, but php-apis, apipy and the iOS sync still read it. The asset registers the apps show today are groups of type asset (tPri\_Business), not rows here.                                                                                                       | BASE TABLE |
| [assetRegCatKey](https://docs.snapfix.com/engineering-reference/db/tables/assetregcatkey.md)                                | 20      | Legacy: one attribute rule of an old asset register (key, category, unique and mandatory flags); 120 rows, none added or changed after November 2022. Only php-apis names it.                                                                                                                                                                                                                               | BASE TABLE |
| [tPri\_BusinessJobAttributeRule](https://docs.snapfix.com/engineering-reference/db/tables/tpri_businessjobattributerule.md) | 20      | A custom field of an asset register (UI: asset attributes), such as Asset ID or Location; each asset's value is in tPri\_JobAttribute. Almost all rows belong to asset registers.                                                                                                                                                                                                                           | BASE TABLE |
| [tPri\_JobAsset](https://docs.snapfix.com/engineering-reference/db/tables/tpri_jobasset.md)                                 | 14      | Legacy link between a task and an asset of the old asset table (assetMain); 35 rows, the newest from 2023-03. Asset links are now kept in tPri\_JobJobLink.                                                                                                                                                                                                                                                 | BASE TABLE |
| [tPri\_JobAttribute](https://docs.snapfix.com/engineering-reference/db/tables/tpri_jobattribute.md)                         | 23      | The value of one attribute (name, category, key and value) on one asset or task, following the register's attribute rule (tPri\_BusinessJobAttributeRule).                                                                                                                                                                                                                                                  | BASE TABLE |
| [tPri\_JobJobLink](https://docs.snapfix.com/engineering-reference/db/tables/tpri_jobjoblink.md)                             | 15      | Links a task (uuid\_tJob\_a) to an asset (uuid\_tJob\_b), with the group of each; all but 9 staging rows are task-to-asset links.                                                                                                                                                                                                                                                                           | BASE TABLE |
| [tPri\_ParentJobAttributeRule](https://docs.snapfix.com/engineering-reference/db/tables/tpri_parentjobattributerule.md)     | 20      | One asset attribute rule of a site, a key under a category with unique and mandatory settings. php-apis's sync sends it to the apps, no in-scope code writes it, and no row is newer than 2022-11. Whether site rules still apply to asset registers is open \[[ASK-101](https://github.com/snapfix/docs/blob/main/ASK.md#ask-101-are-site-level-attribute-rules-still-meant-to-apply-to-asset-registers)]. | BASE TABLE |

## Relations

```mermaid
erDiagram

"assetAttribute" }o--o| "assetMain" : "FOREIGN KEY (uuid_assetMain) REFERENCES assetMain (uuid)"
"assetMain" }o--o| "assetReg" : "FOREIGN KEY (uuid_assetReg) REFERENCES assetReg (uuid)"
"assetRegCatKey" }o--o| "assetReg" : "FOREIGN KEY (uuid_assetReg) REFERENCES assetReg (uuid)"
"tPri_JobAsset" }o--o| "assetMain" : "FOREIGN KEY (uuid_assetMain) REFERENCES assetMain (uuid)"

"assetAttribute" {
  varchar_255_ uuid_assetMain
}
"assetMain" {
  varchar_255_ uuid
  varchar_255_ uuid_assetReg
}
"assetParentCatKey" {
}
"assetReg" {
  varchar_255_ uuid
}
"assetRegCatKey" {
  varchar_255_ uuid_assetReg
}
"tPri_BusinessJobAttributeRule" {
}
"tPri_JobAsset" {
  varchar_255_ uuid_assetMain
}
"tPri_JobAttribute" {
}
"tPri_JobJobLink" {
}
"tPri_ParentJobAttributeRule" {
}
```

***

> 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-9.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.
