> 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/tpri_parentjobattributerule.md).

# tPri\_ParentJobAttributeRule

{% 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/tPri_ParentJobAttributeRule.md).
{% endhint %}

## Description

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)].

<details>

<summary><strong>Table Definition</strong></summary>

```sql
CREATE TABLE `tPri_ParentJobAttributeRule` (
  `id` int NOT NULL AUTO_INCREMENT,
  `uuid` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `uuid_tParent` varchar(255) CHARACTER SET latin1 DEFAULT NULL,
  `atCategory` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `atKey` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `atKeyUnique` tinyint DEFAULT '0',
  `atValueUnique` tinyint DEFAULT '0',
  `atMandatory` tinyint DEFAULT '0',
  `sort_order` int DEFAULT '1000',
  `valType` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `fOrigin` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `fInActive` tinyint DEFAULT '0',
  `fDeleted` tinyint DEFAULT '0',
  `fCreatedTs` bigint DEFAULT NULL,
  `fModifiedTs` bigint DEFAULT NULL,
  `fServerTs` bigint DEFAULT NULL,
  `uuid_tUser_CreatedBy` varchar(255) CHARACTER SET latin1 DEFAULT NULL,
  `uuid_tUser_ModifiedBy` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `excludeFromApi` tinyint DEFAULT '0',
  `excludeFromApiTs` bigint DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `uuid` (`uuid`) USING BTREE,
  KEY `Uuid_ServerTs` (`uuid`,`fServerTs`),
  KEY `fk_assetParentCatKey_parent` (`uuid_tParent`),
  KEY `fk_assetParentCatKey_createdbyuser` (`uuid_tUser_CreatedBy`),
  CONSTRAINT `tPri_ParentJobAttributeRule_ibfk_1` FOREIGN KEY (`uuid_tUser_CreatedBy`) REFERENCES `tPri_User` (`uuid`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `tPri_ParentJobAttributeRule_ibfk_2` FOREIGN KEY (`uuid_tParent`) REFERENCES `tPri_Parent` (`uuid`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
```

</details>

## Columns

| Name                    | Type         | Default | Nullable | Extra Definition | Parents                                                                                 | Comment                                |
| ----------------------- | ------------ | ------- | -------- | ---------------- | --------------------------------------------------------------------------------------- | -------------------------------------- |
| id                      | int          |         | false    | auto\_increment  |                                                                                         |                                        |
| uuid                    | varchar(255) |         | true     |                  |                                                                                         |                                        |
| uuid\_tParent           | varchar(255) |         | true     |                  | [tPri\_Parent](https://docs.snapfix.com/engineering-reference/db/tables/tpri_parent.md) |                                        |
| atCategory              | varchar(255) |         | true     |                  |                                                                                         |                                        |
| atKey                   | varchar(255) |         | true     |                  |                                                                                         |                                        |
| atKeyUnique             | tinyint      | 0       | true     |                  |                                                                                         | 1 = the key must be unique.            |
| atValueUnique           | tinyint      | 0       | true     |                  |                                                                                         | 1 = the value must be unique.          |
| atMandatory             | tinyint      | 0       | true     |                  |                                                                                         | 1 = the attribute is required.         |
| sort\_order             | int          | 1000    | true     |                  |                                                                                         |                                        |
| valType                 | varchar(255) |         | true     |                  |                                                                                         | Value type; text on every staging row. |
| fOrigin                 | varchar(255) |         | true     |                  |                                                                                         |                                        |
| fInActive               | tinyint      | 0       | true     |                  |                                                                                         |                                        |
| fDeleted                | tinyint      | 0       | true     |                  |                                                                                         |                                        |
| fCreatedTs              | bigint       |         | true     |                  |                                                                                         |                                        |
| fModifiedTs             | bigint       |         | true     |                  |                                                                                         |                                        |
| fServerTs               | bigint       |         | true     |                  |                                                                                         |                                        |
| uuid\_tUser\_CreatedBy  | varchar(255) |         | true     |                  | [tPri\_User](https://docs.snapfix.com/engineering-reference/db/tables/tpri_user.md)     |                                        |
| uuid\_tUser\_ModifiedBy | varchar(255) |         | true     |                  |                                                                                         |                                        |
| excludeFromApi          | tinyint      | 0       | true     |                  |                                                                                         |                                        |
| excludeFromApiTs        | bigint       |         | true     |                  |                                                                                         |                                        |

## Viewpoints

| Name                                                                              | Definition                                                                                                    |
| --------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
| [assets](https://docs.snapfix.com/engineering-reference/db/tables/viewpoint-9.md) | Asset registers and their categories, attributes and attribute rules, and the links between tasks and assets. |

## Constraints

| Name                                  | Type        | Definition                                                        |
| ------------------------------------- | ----------- | ----------------------------------------------------------------- |
| PRIMARY                               | PRIMARY KEY | PRIMARY KEY (id)                                                  |
| tPri\_ParentJobAttributeRule\_ibfk\_1 | FOREIGN KEY | FOREIGN KEY (uuid\_tUser\_CreatedBy) REFERENCES tPri\_User (uuid) |
| tPri\_ParentJobAttributeRule\_ibfk\_2 | FOREIGN KEY | FOREIGN KEY (uuid\_tParent) REFERENCES tPri\_Parent (uuid)        |
| uuid                                  | UNIQUE      | UNIQUE KEY uuid (uuid)                                            |

## Indexes

| Name                                 | Definition                                                                    |
| ------------------------------------ | ----------------------------------------------------------------------------- |
| fk\_assetParentCatKey\_createdbyuser | KEY fk\_assetParentCatKey\_createdbyuser (uuid\_tUser\_CreatedBy) USING BTREE |
| fk\_assetParentCatKey\_parent        | KEY fk\_assetParentCatKey\_parent (uuid\_tParent) USING BTREE                 |
| Uuid\_ServerTs                       | KEY Uuid\_ServerTs (uuid, fServerTs) USING BTREE                              |
| PRIMARY                              | PRIMARY KEY (id) USING BTREE                                                  |
| uuid                                 | UNIQUE KEY uuid (uuid) USING BTREE                                            |

## Relations

```mermaid
erDiagram

"tPri_ParentJobAttributeRule" }o--o| "tPri_Parent" : "FOREIGN KEY (uuid_tParent) REFERENCES tPri_Parent (uuid)"
"tPri_ParentJobAttributeRule" }o--o| "tPri_User" : "FOREIGN KEY (uuid_tUser_CreatedBy) REFERENCES tPri_User (uuid)"

"tPri_ParentJobAttributeRule" {
  int id PK
  varchar_255_ uuid_tParent FK
  varchar_255_ uuid_tUser_CreatedBy FK
}
"tPri_Parent" {
  int id PK
  varchar_255_ uuid
  varchar_255_ uuid_tUser_CreatedBy FK
}
"tPri_User" {
  int id PK
  varchar_255_ uuid
  varchar_255_ uuid_tUser_CreatedBy FK
}
```

***

> 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/tpri_parentjobattributerule.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.
