> For the complete documentation index, see [llms.txt](https://specs.govstack.global/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://specs.govstack.global/registries/development/7-data-structures.md).

# 7 Data Structures

## 7.1 Resource Model

The resource model shows the relationship between data objects that are used by this Building Block.

{% @mermaid/diagram content="erDiagram
DATABASE||--o{ DATA: has
DATABASE {
int id
varchar name
json schema
numeric version   }
DATA ||--|{ AUDIT-LOG: creates
DATA {
int id
varchar registry-number
varchar field-type
varchar value
}
AUDIT-LOG {
varchar old-value
varchar new-value    }
DATABASE ||--|{ SCHEMA: has
SCHEMA {
int id
varchar path    }
SCHEMA ||--|{ DATA: contains" %}

## 7.2 Data Structures <a href="#docs-internal-guid-f4ace18b-7fff-ada5-ebbb-3aaf5e08cb17" id="docs-internal-guid-f4ace18b-7fff-ada5-ebbb-3aaf5e08cb17"></a>

The Data Structures provide detail for the Resource Model defined above. This section will list the core/required fields for each resource.

### 7.2.1 Minimum Required Data

**Description:** The Data Structures can be extended for a particular use case, but they must always contain, at the minimum, the fields defined here.

**Fields:**

<table><thead><tr><th>Name</th><th>Type</th><th>Description</th><th>Notes</th><th data-hidden></th></tr></thead><tbody><tr><td>Database ID</td><td>integer</td><td>Unique identifier of a database.</td><td>Required</td><td></td></tr><tr><td>Database name</td><td>varchar</td><td>Name that will define the database content. Name is public.</td><td>Required</td><td></td></tr><tr><td>Schema ID</td><td>integer</td><td>Database schema ID</td><td>Required</td><td></td></tr><tr><td>Database schema</td><td>json object</td><td>Database schema. See example in Chapters 7.3.1 and 7.3.2.</td><td>Required</td><td></td></tr><tr><td>Version</td><td>numeric</td><td>Database version. Each change in schema will produce the next version of the database and API services.</td><td>Required</td><td></td></tr><tr><td>Data ID</td><td>integer</td><td>Data element unique identifier.</td><td>Required</td><td></td></tr><tr><td>Registry number</td><td>varchar</td><td>Additional registry identifier. Unique identifier in the registry.</td><td>Required</td><td></td></tr><tr><td>Field type</td><td>varchar</td><td>Field type: datetime, date, boolean, text, number, file.</td><td>Required</td><td></td></tr><tr><td>Field value</td><td>datetime, date, boolean, text, number</td><td>Field value, data stored in the field.</td><td>Required</td><td></td></tr><tr><td>Audit log old value</td><td>datetime, date, boolean, text, number</td><td>Field value before change.</td><td>Required</td><td></td></tr><tr><td>Audit log new value</td><td>datetime, date, boolean, text, number</td><td>Field value after the change.</td><td>Required</td><td></td></tr></tbody></table>


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://specs.govstack.global/registries/development/7-data-structures.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
