# ZeyOS Database Reference — LLM full working set

## Spec
- dbref.json: /__doc/dbref.json

## Table index (JSON)
- /ai/db/tables.json

## Relations graph (JSON)
- /ai/db/relations.json

## Per-table docs (Markdown)
- Each table/view is available as `/ai/db/table.<name>.md` (URL provided in tables.json).
- Each table/view is also available as `/ai/db/table.<name>.json` (URL provided in tables.json).

## Common entities (starting points)
- accounts: /ai/db/table.accounts.md
- contacts: /ai/db/table.contacts.md
- projects: /ai/db/table.projects.md
- tasks: /ai/db/table.tasks.md
- tickets: /ai/db/table.tickets.md
- opportunities: /ai/db/table.opportunities.md
- transactions: /ai/db/table.transactions.md

---

# accounts (table)

Customer and supplier accounts with billing, financial, and contact information.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | integer | yes |  | Account ID |  |
| fork | integer | no |  | Fork ID (`null` for base module) | forks.ID (fk_accounts_fork) |
| ownergroup | integer | no |  | Owner group ID (`null`=PUBLIC) | groups.ID (fk_accounts_ownergroup) |
| creator | integer | no |  | Creator user ID (defaults to authenticated user on creation) |  |
| assigneduser | integer | no |  | Assigned user ID | users.ID (fk_accounts_assigneduser) |
| creationdate | bigint | yes | date_part('epoch', now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | date_part('epoch', now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| contact | integer | no |  | Contact ID | contacts.ID (fk_accounts_contact) |
| visibility | smallint | yes | 0 | Visibility (`0`=REGULAR, `1`=ARCHIVED, `2`=DELETED) |  |
| lastname | text | yes | '' | Last name (surname or company name); is required if `firstname` is empty |  |
| firstname | text | yes | '' | First name (given name); is required if `lastname` is empty |  |
| type | smallint | yes | 0 | Account type (`0`=PROSPECT, `1`=CUSTOMER, `2`=SUPPLIER, `3`=CUSTOMERANDSUPPLIER, `4`=COMPETITOR, `5`=EMPLOYEE) |  |
| customernum | text | yes | '' | Customer number; only for PROSPECT, CUSTOMERANDSUPPLIER, CUSTOMER or EMPLOYEE |  |
| suppliernum | text | yes | '' | Supplier number; only for SUPPLIER or CUSTOMERANDSUPPLIER |  |
| taxid | text | yes | '' | Tax ID (e.g. VATIN or SSN) |  |
| currency | character varying(3) | yes |  | Currency code ([ISO 4217](https://en.wikipedia.org/wiki/ISO_4217)) |  |
| locked | smallint | yes | 0 | Deny booking of billing or procurement transactions |  |
| excludetax | smallint | yes | 0 | Exclude from taxation |  |
| description | text | yes | '' | Detailed general description |  |

## Outbound foreign keys
- fork → forks.ID (fk_accounts_fork)
- ownergroup → groups.ID (fk_accounts_ownergroup)
- assigneduser → users.ID (fk_accounts_assigneduser)
- contact → contacts.ID (fk_accounts_contact)

## Inbound references
- actionsteps.account → accounts.ID (fk_actionsteps_account)
- addresses.account → accounts.ID (fk_addresses_account)
- contracts.account → accounts.ID (fk_contracts_account)
- dunning.account → accounts.ID (fk_dunning_account)
- opportunities.account → accounts.ID (fk_opportunities_account)
- payments.account → accounts.ID (fk_payments_account)
- pricelists2accounts.account → accounts.ID (fk_pricelists2accounts_account)
- projects.account → accounts.ID (fk_projects_account)
- suppliers.account → accounts.ID (fk_suppliers_account)
- tickets.account → accounts.ID (fk_tickets_account)
- transactions.account → accounts.ID (fk_transactions_account)

---

# actionsteps (table)

Time-tracked action steps linked to tasks, tickets, or accounts.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | integer | yes |  | Action step ID |  |
| fork | integer | no |  | Fork ID (`null` for base module) | forks.ID (fk_actionsteps_fork) |
| owneruser | integer | no |  | Owner user ID (PUBLIC if `owneruser`=`null` and `ownergroup`=`null`) | users.ID (fk_actionsteps_owneruser) |
| ownergroup | integer | no |  | Owner group ID (PUBLIC if `owneruser`=`null` and `ownergroup`=`null`) | groups.ID (fk_actionsteps_ownergroup) |
| creator | integer | no |  | Creator user ID (defaults to authenticated user on creation) |  |
| assigneduser | integer | no |  | Assigned user ID | users.ID (fk_actionsteps_assigneduser) |
| creationdate | bigint | yes | date_part('epoch', now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | date_part('epoch', now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| task | integer | no |  | Task ID; is mutually exclusive to `ticket` and `account` | tasks.ID (fk_actionsteps_task) |
| ticket | integer | no |  | Ticket ID; is mutually exclusive to `task` and `account` | tickets.ID (fk_actionsteps_ticket) |
| account | integer | no |  | Account ID; is mutually exclusive to `task` and `ticket` | accounts.ID (fk_actionsteps_account) |
| transaction | integer | no |  | Transaction ID | transactions.ID (fk_actionsteps_transaction) |
| name | text | yes |  | Name |  |
| actionnum | text | yes | '' | Action number |  |
| date | bigint | yes | date_part('epoch', now()) | Designated date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| duedate | bigint | no |  | Due date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) |  |
| status | smallint | yes | 0 | Status (`0`=DRAFT, `1`=COMPLETED, `2`=CANCELLED, `3`=BOOKED) |  |
| effort | integer | yes | 0 | Effort in minutes |  |
| description | text | yes | '' | Detailed general description |  |

## Outbound foreign keys
- fork → forks.ID (fk_actionsteps_fork)
- owneruser → users.ID (fk_actionsteps_owneruser)
- ownergroup → groups.ID (fk_actionsteps_ownergroup)
- assigneduser → users.ID (fk_actionsteps_assigneduser)
- task → tasks.ID (fk_actionsteps_task)
- ticket → tickets.ID (fk_actionsteps_ticket)
- account → accounts.ID (fk_actionsteps_account)
- transaction → transactions.ID (fk_actionsteps_transaction)

## Inbound references
- (none)

---

# addresses (table)

Billing and shipping addresses linking accounts to contacts.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | bigint | yes |  | Address ID |  |
| creator | integer | no |  | Creator user ID (defaults to authenticated user on creation) |  |
| creationdate | bigint | yes | date_part('epoch', now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | date_part('epoch', now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| account | integer | yes |  | Account ID (**dependency**) | accounts.ID (fk_addresses_account) |
| contact | integer | yes |  | Contact ID | contacts.ID (fk_addresses_contact) |
| type | smallint | yes | 0 | Address type (`0`=BILLING_SHIPPING, `1`=BILLING_BILLING, `2`=PROCUREMENT_SHIPPING, `3`=PROCUREMENT_BILLING, `4`=COLLECTION, `5`=BILLING_SELLER, `6`=PROCUREMENT_SELLER) |  |
| default | smallint | yes | 0 | Default for this address type |  |

## Outbound foreign keys
- account → accounts.ID (fk_addresses_account)
- contact → contacts.ID (fk_addresses_contact)

## Inbound references
- (none)

---

# applicationassets (table)

Static assets and files belonging to ZeyOS applications.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | bigint | yes |  | Asset ID |  |
| creator | integer | no |  | Creator user ID (defaults to authenticated user on creation) |  |
| creationdate | bigint | yes | EXTRACT(epoch FROM now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | EXTRACT(epoch FROM now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| application | integer | yes |  | Application ID (**dependency**) | applications.ID (fk_applicationassets_application) |
| binfile | integer | no |  | Binary file ID; is read-only (not for `PUT` or `PATCH`) | binfiles.ID (fk_applicationassets_binfile) |
| filename | text | yes |  | Filename |  |
| mimetype | text | yes | 'application/octet-stream' | [MIME type](https://en.wikipedia.org/wiki/Media_type) ([RFC 2045](https://tools.ietf.org/html/rfc2045)) |  |

## Outbound foreign keys
- application → applications.ID (fk_applicationassets_application)
- binfile → binfiles.ID (fk_applicationassets_binfile)

## Inbound references
- (none)

---

# applications (table)

ZeyOS applications with settings, versioning, and OAuth configuration.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | integer | yes |  | Application ID |  |
| creator | integer | no |  | Creator user ID (defaults to authenticated user on creation) |  |
| creationdate | bigint | yes | date_part('epoch', now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | date_part('epoch', now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| activity | smallint | yes | 0 | Activity (`0`=ACTIVE, `1`=DEACTIVATED, `2`=DELETED) |  |
| readmebinfile | integer | no |  | Binary file ID; is read-only (not for `PUT` or `PATCH`) | binfiles.ID (fk_applications_readmebinfile) |
| name | text | yes |  | Name |  |
| identifier | character varying(200) | yes |  | Unique application identifier |  |
| vendor | text | yes | '' | Vendor (developer or company name) |  |
| restricted | smallint | yes | 0 | Restricted access via permission with same identifier |  |
| callbackurls | text[] | no |  | [Array](https://www.postgresql.org/docs/current/arrays.html)-encoded allowed callback URLs for APIs |  |
| settingscodebinfile | integer | no |  |  | binfiles.ID (fk_applications_settingscodebinfile) |
| usersettingscodebinfile | integer | no |  |  | binfiles.ID (fk_applications_usersettingscodebinfile) |
| secret | bytea | no |  |  |  |
| defaultsettings | json | no |  |  |  |
| settings | json | no |  |  |  |

## Outbound foreign keys
- readmebinfile → binfiles.ID (fk_applications_readmebinfile)
- settingscodebinfile → binfiles.ID (fk_applications_settingscodebinfile)
- usersettingscodebinfile → binfiles.ID (fk_applications_usersettingscodebinfile)

## Inbound references
- applicationassets.application → applications.ID (fk_applicationassets_application)
- permissions.application → applications.ID (fk_permissions_application)
- resources.application → applications.ID (fk_resources_application)
- services.application → applications.ID (fk_services_application)
- tokens.application → applications.ID (fk_tokens_application)
- weblets.application → applications.ID (fk_weblets_application)

---

# appointments (table)

Calendar appointments with recurrence, location, and color coding.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | integer | yes |  | Appointment ID |  |
| fork | integer | no |  | Fork ID (`null` for base module) | forks.ID (fk_appointments_fork) |
| owneruser | integer | no |  | Owner user ID (PUBLIC if `owneruser`=`null` and `ownergroup`=`null`) | users.ID (fk_appointments_owneruser) |
| ownergroup | integer | no |  | Owner group ID (PUBLIC if `owneruser`=`null` and `ownergroup`=`null`) | groups.ID (fk_appointments_ownergroup) |
| creator | integer | no |  | Creator user ID (defaults to authenticated user on creation) |  |
| assigneduser | integer | no |  | Assigned user ID | users.ID (fk_appointments_assigneduser) |
| creationdate | bigint | yes | date_part('epoch', now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | date_part('epoch', now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| davserver | integer | no |  | DAV server ID | davservers.ID (fk_appointments_davserver) |
| visibility | smallint | yes | 0 | Visibility (`0`=REGULAR, `1`=ARCHIVED, `2`=DELETED) |  |
| name | text | yes |  | Name |  |
| location | text | yes | '' | Location |  |
| color | character varying(6) | yes | '' | Color code (CSS-style hexadecimal without `#`) |  |
| datefrom | bigint | yes |  | Start date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time); must be less than or equal to `dateto` |  |
| dateto | bigint | yes |  | End date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time); must be greater than or equal to `datefrom` |  |
| recurrence | smallint | no |  | Recurrence (`0`=DAY, `1`=WORKDAY, `2`=WEEK, `3`=MONTH, `4`=YEAR) |  |
| interval | smallint | yes | 1 | Recurrence interval in minutes |  |
| maxoccurrences | integer | yes | 0 | Maximum number of occurrences including the start date (`0`=unlimited) |  |
| daterecurrence | bigint | no |  | Recurrence end date as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) |  |
| description | text | yes | '' | Detailed general description |  |

## Outbound foreign keys
- fork → forks.ID (fk_appointments_fork)
- owneruser → users.ID (fk_appointments_owneruser)
- ownergroup → groups.ID (fk_appointments_ownergroup)
- assigneduser → users.ID (fk_appointments_assigneduser)
- davserver → davservers.ID (fk_appointments_davserver)

## Inbound references
- davids.appointment → appointments.ID (fk_davids_appointment)
- invitations.appointment → appointments.ID (fk_invitations_appointment)

---

# associations (table)

Generic many-to-many relationships between any two entities.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | bigint | yes |  | Association ID |  |
| creator | integer | no |  | Creator user ID (defaults to authenticated user on creation) |  |
| creationdate | bigint | yes | date_part('epoch', now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | EXTRACT(epoch FROM now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| entity1 | t_entity | yes |  | First canonical entity |  |
| entity2 | t_entity | yes |  | Second canonical entity |  |
| index1 | integer | yes |  | First entity ID |  |
| index2 | integer | yes |  | Second entity ID |  |
| relation | text | yes | '' | Relation |  |
| meta | json | no |  | [JSON](https://tools.ietf.org/html/rfc7159)-encoded metadata (object) |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# binfiles (table)

Binary file storage with hash-based deduplication.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | integer | yes |  | Bin file ID |  |
| size | integer | yes |  | Size in bytes |  |
| hash | bytea | yes |  | [MD5](https://tools.ietf.org/html/rfc1321) hash of the content in hexadecimal notation prefixed with '\x' |  |

## Outbound foreign keys
- (none)

## Inbound references
- applicationassets.binfile → binfiles.ID (fk_applicationassets_binfile)
- applications.readmebinfile → binfiles.ID (fk_applications_readmebinfile)
- applications.settingscodebinfile → binfiles.ID (fk_applications_settingscodebinfile)
- applications.usersettingscodebinfile → binfiles.ID (fk_applications_usersettingscodebinfile)
- contacts.picbinfile → binfiles.ID (fk_contacts_picbinfile)
- documents.binfile → binfiles.ID (fk_documents_binfile)
- files.binfile → binfiles.ID (fk_files_binfile)
- items.picbinfile → binfiles.ID (fk_items_picbinfile)
- mailservers.autoreplybinfile → binfiles.ID (fk_mailservers_autoreplybinfile)
- mailservers.signaturebinfile → binfiles.ID (fk_mailservers_signaturebinfile)
- messages.binfile → binfiles.ID (fk_messages_binfile)
- notes.binfile → binfiles.ID (fk_notes_binfile)
- objects.binfile → binfiles.ID (fk_objects_binfile)
- resources.binfile → binfiles.ID (fk_resources_binfile)
- services.binfile → binfiles.ID (fk_services_binfile)
- weblets.binfile → binfiles.ID (fk_weblets_binfile)

---

# campaigns (table)

Marketing campaigns with status tracking and date ranges.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | integer | yes |  | Campaign ID |  |
| fork | integer | no |  | Fork ID (`null` for base module) | forks.ID (fk_campaigns_fork) |
| ownergroup | integer | no |  | Owner group ID (`null`=PUBLIC) | groups.ID (fk_campaigns_ownergroup) |
| creator | integer | no |  | Creator user ID (defaults to authenticated user on creation) |  |
| assigneduser | integer | no |  | Assigned user ID | users.ID (fk_campaigns_assigneduser) |
| creationdate | bigint | yes | date_part('epoch', now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | date_part('epoch', now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| visibility | smallint | yes | 0 | Visibility (`0`=REGULAR, `1`=ARCHIVED, `2`=DELETED) |  |
| name | text | yes |  | Name |  |
| datefrom | bigint | yes |  | Start date as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time); must be less than or equal to `dateto` |  |
| dateto | bigint | no |  | End date as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time); must be greater than or equal to `datefrom` |  |
| status | smallint | yes | 0 | Status (`0`=DRAFT, `1`=NOTSTARTED, `2`=AWAITINGAPPROVAL, `3`=APPROVED, `4`=DISMISSED, `5`=ACTIVE, `6`=INACTIVE, `7`=INEVALUATION, `8`=CANCELLED, `9`=CLOSED) |  |
| description | text | yes | '' | Detailed general description |  |

## Outbound foreign keys
- fork → forks.ID (fk_campaigns_fork)
- ownergroup → groups.ID (fk_campaigns_ownergroup)
- assigneduser → users.ID (fk_campaigns_assigneduser)

## Inbound references
- mailinglists.campaign → campaigns.ID (fk_mailinglists_campaign)
- opportunities.campaign → campaigns.ID (fk_opportunities_campaign)
- participants.campaign → campaigns.ID (fk_participants_campaign)

---

# categories (table)

User-defined categories for organizing entities.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | integer | yes |  | Category ID |  |
| fork | integer | no |  | Fork ID (`null` for base module) | forks.ID (fk_categories_fork) |
| owneruser | integer | no |  | Owner user ID (PUBLIC if `owneruser`=`null` and `ownergroup`=`null`) | users.ID (fk_categories_owneruser) |
| ownergroup | integer | no |  | Owner group ID (PUBLIC if `owneruser`=`null` and `ownergroup`=`null`) | groups.ID (fk_categories_ownergroup) |
| creator | integer | no |  | Creator user ID (defaults to authenticated user on creation) |  |
| creationdate | bigint | yes | date_part('epoch', now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | EXTRACT(epoch FROM now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| entity | text | yes |  | Canonical entity |  |
| name | text | yes |  | Name |  |

## Outbound foreign keys
- fork → forks.ID (fk_categories_fork)
- owneruser → users.ID (fk_categories_owneruser)
- ownergroup → groups.ID (fk_categories_ownergroup)

## Inbound references
- (none)

---

# changes (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| entity | t_entity | yes |  |  |  |
| index | integer | yes |  |  |  |
| user | integer | no |  |  |  |
| date | double precision | yes |  |  |  |
| type | smallint | yes |  |  |  |
| identifier | text | yes |  |  |  |
| transactionid | bytea | no |  |  |  |
| data | jsonb | no |  |  |  |
| extdata | jsonb | no |  |  |  |
| tags_add | text[] | no |  |  |  |
| tags_remove | text[] | no |  |  |  |
| binfiles | integer[] | no |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# channels (table)

Communication channels for entity notifications and updates.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | integer | yes |  | Channel ID |  |
| owneruser | integer | no |  | Owner user ID (PUBLIC if `owneruser`=`null` and `ownergroup`=`null`) | users.ID (fk_channels_owneruser) |
| ownergroup | integer | no |  | Owner group ID (PUBLIC if `owneruser`=`null` and `ownergroup`=`null`) | groups.ID (fk_channels_ownergroup) |
| creator | integer | no |  | Creator user ID (defaults to authenticated user on creation) |  |
| creationdate | bigint | yes | date_part('epoch', now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | EXTRACT(epoch FROM now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| activity | smallint | yes | 0 | Activity (`0`=ACTIVE, `1`=DEACTIVATED, `2`=DELETED) |  |
| name | text | yes |  | Name |  |
| description | text | yes | '' | Detailed general description |  |

## Outbound foreign keys
- owneruser → users.ID (fk_channels_owneruser)
- ownergroup → groups.ID (fk_channels_ownergroup)

## Inbound references
- entities2channels.channel → channels.ID (fk_entities2channels_channel)
- feedservers.channel → channels.ID (fk_feedservers_channel)
- records.channel → channels.ID (fk_records_channel)

---

# comments (table)

User comments attached to activity records.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | bigint | yes |  | Comment ID |  |
| creator | integer | no |  | Creator user ID (defaults to authenticated user on creation) |  |
| creationdate | bigint | yes | date_part('epoch', now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | EXTRACT(epoch FROM now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| record | bigint | yes |  | Record ID (**dependency**) | records.ID (fk_comments_record) |
| date | bigint | yes | EXTRACT(epoch FROM now()) | Designated date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| sender | text | yes | '' | Sender |  |
| text | text | yes | '' | Comment text ([Markdown](https://en.wikipedia.org/wiki/Markdown) for rich text representation) |  |
| meta | json | no |  | [JSON](https://tools.ietf.org/html/rfc7159)-encoded metadata (object) |  |

## Outbound foreign keys
- record → records.ID (fk_comments_record)

## Inbound references
- files.comment → comments.ID (fk_files_comment)

---

# components (table)

Bill of materials linking parent items to component items.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | bigint | yes |  | Component ID |  |
| creator | integer | no |  | Creator user ID (defaults to authenticated user on creation) |  |
| creationdate | bigint | yes | date_part('epoch', now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | date_part('epoch', now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| item | integer | yes |  | Item ID (**dependency**) | items.ID (fk_components_item) |
| component | integer | yes |  | Component item ID; must be distinct from `item` | items.ID (fk_components_component) |
| amount | double precision | yes | 0 | Amount (quantity) |  |
| price | double precision | no |  | Imputed price per unit |  |
| fixed | smallint | yes | 0 | Fixed quantity |  |
| order | integer | no |  |  |  |

## Outbound foreign keys
- item → items.ID (fk_components_item)
- component → items.ID (fk_components_component)

## Inbound references
- (none)

---

# contacts (table)

Contact records with personal, company, and address information.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | integer | yes |  | Contact ID |  |
| fork | integer | no |  | Fork ID (`null` for base module) | forks.ID (fk_contacts_fork) |
| owneruser | integer | no |  | Owner user ID (PUBLIC if `owneruser`=`null` and `ownergroup`=`null`) | users.ID (fk_contacts_owneruser) |
| ownergroup | integer | no |  | Owner group ID (PUBLIC if `owneruser`=`null` and `ownergroup`=`null`) | groups.ID (fk_contacts_ownergroup) |
| creator | integer | no |  | Creator user ID (defaults to authenticated user on creation) |  |
| assigneduser | integer | no |  | Assigned user ID | users.ID (fk_contacts_assigneduser) |
| creationdate | bigint | yes | date_part('epoch', now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | date_part('epoch', now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| davserver | integer | no |  | DAV server ID | davservers.ID (fk_contacts_davserver) |
| picbinfile | integer | no |  | Binary file ID; is read-only (not for `PUT` or `PATCH`) | binfiles.ID (fk_contacts_picbinfile) |
| visibility | smallint | yes | 0 | Visibility (`0`=REGULAR, `1`=ARCHIVED, `2`=DELETED) |  |
| lastname | text | yes | '' | Last name (surname or company name); is required if `firstname` is empty |  |
| firstname | text | yes | '' | First name (given name); is required if `lastname` is empty |  |
| type | smallint | yes | 0 | Contact type (`0`=COMPANY, `1`=PERSON) |  |
| title | text | yes | '' | Title or salutation; only for PERSON |  |
| company | text | yes | '' | Company name; only for PERSON |  |
| position | text | yes | '' | Position or job title; only for PERSON |  |
| department | text | yes | '' | Department; only for PERSON |  |
| address | text | yes | '' | Address (street and building/suite number) |  |
| postalcode | text | yes | '' | Postal or ZIP code |  |
| city | text | yes | '' | City or locality |  |
| region | text | yes | '' | Region or state |  |
| country | character varying(2) | yes | '' | Country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)) |  |
| phone | text | yes | '' | Primary phone number |  |
| phone2 | text | yes | '' | Secondary phone number |  |
| cell | text | yes | '' | Cell phone number |  |
| fax | text | yes | '' | Fax number |  |
| email | text | yes | '' | Primary e-mail address |  |
| email2 | text | yes | '' | Secondary e-mail address |  |
| website | text | yes | '' | Website URL |  |
| birthdate | bigint | no |  | Birth date as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time); only for PERSON |  |
| description | text | yes | '' | Detailed general description |  |

## Outbound foreign keys
- fork → forks.ID (fk_contacts_fork)
- owneruser → users.ID (fk_contacts_owneruser)
- ownergroup → groups.ID (fk_contacts_ownergroup)
- assigneduser → users.ID (fk_contacts_assigneduser)
- davserver → davservers.ID (fk_contacts_davserver)
- picbinfile → binfiles.ID (fk_contacts_picbinfile)

## Inbound references
- accounts.contact → contacts.ID (fk_accounts_contact)
- addresses.contact → contacts.ID (fk_addresses_contact)
- contacts2contacts.contact1 → contacts.ID (fk_contacts2contacts_contact1)
- contacts2contacts.contact2 → contacts.ID (fk_contacts2contacts_contact2)
- davids.contact → contacts.ID (fk_davids_contact)
- invitations.contact → contacts.ID (fk_invitations_contact)
- opportunities.contact → contacts.ID (fk_opportunities_contact)
- participants.contact → contacts.ID (fk_participants_contact)
- users.contact → contacts.ID (fk_users_contact)

---

# contacts2contacts (table)

Junction table linking related contacts to each other.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | bigint | yes |  | Contact-to-contact ID |  |
| creator | integer | no |  | Creator user ID (defaults to authenticated user on creation) |  |
| creationdate | bigint | yes | date_part('epoch', now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | EXTRACT(epoch FROM now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| contact1 | integer | yes |  | First contact ID (**dependency**) | contacts.ID (fk_contacts2contacts_contact1) |
| contact2 | integer | yes |  | Second contact ID (**dependency**) | contacts.ID (fk_contacts2contacts_contact2) |

## Outbound foreign keys
- contact1 → contacts.ID (fk_contacts2contacts_contact1)
- contact2 → contacts.ID (fk_contacts2contacts_contact2)

## Inbound references
- (none)

---

# contracts (table)

Recurring contracts with billing cycles and auto-billing settings.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | integer | yes |  | Contract ID |  |
| fork | integer | no |  | Fork ID (`null` for base module) | forks.ID (fk_contracts_fork) |
| ownergroup | integer | no |  | Owner group ID (`null`=PUBLIC) | groups.ID (fk_contracts_ownergroup) |
| creator | integer | no |  | Creator user ID (defaults to authenticated user on creation) |  |
| assigneduser | integer | no |  | Assigned user ID | users.ID (fk_contracts_assigneduser) |
| creationdate | bigint | yes | date_part('epoch', now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | date_part('epoch', now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| account | integer | no |  | Account ID | accounts.ID (fk_contracts_account) |
| visibility | smallint | yes | 0 | Visibility (`0`=REGULAR, `1`=ARCHIVED, `2`=DELETED) |  |
| name | text | yes |  | Name |  |
| contractnum | text | yes | '' | Contract number |  |
| date | bigint | yes | EXTRACT(epoch FROM now()) | Designated date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| datefrom | bigint | no |  | Start date as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time); must be less than or equal to `dateto` |  |
| dateto | bigint | no |  | End date as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time); must be greater than or equal to `datefrom` |  |
| datecancel | bigint | no |  | Cancellation date as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) |  |
| status | smallint | yes | 0 | Status (`0`=DRAFT, `1`=AWAITINGAPPROVAL, `2`=APPROVED, `3`=DISMISSED, `4`=ACTIVE, `5`=INACTIVE, `6`=EXPIRED, `7`=CANCELLED, `8`=CLOSED) |  |
| currency | character varying(3) | yes |  | Currency code ([ISO 4217](https://en.wikipedia.org/wiki/ISO_4217)) |  |
| exchangerate | double precision | yes | 1 | Exchange rate as a multiple of one monetary unit of the fixed system currency |  |
| billingcycle | smallint | no |  | Billing cycle in months |  |
| lastbilling | bigint | no |  | Last billing date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) |  |
| description | text | yes | '' | Detailed general description |  |
| contractitems | json | no |  | [JSON](https://tools.ietf.org/html/rfc7159)-encoded items (array) |  |
| billingitems | json | no |  | [JSON](https://tools.ietf.org/html/rfc7159)-encoded items (array) |  |
| procurementitems | json | no |  | [JSON](https://tools.ietf.org/html/rfc7159)-encoded items (array) |  |
| autobilling | json | no |  | [JSON](https://tools.ietf.org/html/rfc7159)-encoded auto-billing data (object); only if `billingcycle` is not `null` |  |

## Outbound foreign keys
- fork → forks.ID (fk_contracts_fork)
- ownergroup → groups.ID (fk_contracts_ownergroup)
- assigneduser → users.ID (fk_contracts_assigneduser)
- account → accounts.ID (fk_contracts_account)

## Inbound references
- devices.contract → contracts.ID (fk_devices_contract)
- transactions.contract → contracts.ID (fk_transactions_contract)

---

# couponcodes (table)

Individual coupon codes with redemption tracking.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | bigint | yes |  | Coupon code ID |  |
| creator | integer | no |  | Creator user ID (defaults to authenticated user on creation) |  |
| creationdate | bigint | yes | date_part('epoch', now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | date_part('epoch', now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| coupon | integer | yes |  | Coupon ID (**dependency**) | coupons.ID (fk_couponcodes_coupon) |
| transaction | integer | no |  | Transaction ID | transactions.ID (fk_couponcodes_transaction) |
| flag | smallint | yes | 0 | Flag (`0`=BOOKED, `1`=RESERVED, `2`=CANCELLED) |  |
| date | bigint | yes | date_part('epoch', now()) | Designated date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| code | text | yes |  | Coupon code |  |
| value | double precision | yes | 0 | Value |  |
| datefrom | bigint | no |  | Start date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time); must be less than or equal to `dateto` |  |
| dateto | bigint | no |  | End date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time); must be greater than or equal to `datefrom` |  |

## Outbound foreign keys
- coupon → coupons.ID (fk_couponcodes_coupon)
- transaction → transactions.ID (fk_couponcodes_transaction)

## Inbound references
- (none)

---

# coupons (table)

Discount coupons with value, tax rate, and validity periods.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | integer | yes |  | Coupon ID |  |
| fork | integer | no |  | Fork ID (`null` for base module) | forks.ID (fk_coupons_fork) |
| ownergroup | integer | no |  | Owner group ID (`null`=PUBLIC) | groups.ID (fk_coupons_ownergroup) |
| creator | integer | no |  | Creator user ID (defaults to authenticated user on creation) |  |
| creationdate | bigint | yes | date_part('epoch', now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | date_part('epoch', now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| activity | smallint | yes | 0 | Activity (`0`=ACTIVE, `1`=DEACTIVATED, `2`=DELETED) |  |
| name | text | yes |  | Name |  |
| type | smallint | yes | 0 | Coupon type (`0`=PROMOTION, `1`=INDIVIDUAL) |  |
| code | text | yes | '' | Promotion code; only for PROMOTION |  |
| value | double precision | yes | 0 | Default value |  |
| taxrate | double precision | no |  | Tax rate in percent |  |
| neutral | smallint | yes | 0 | Neutral in transaction |  |
| datefrom | bigint | no |  | Start date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time); must be less than or equal to `dateto` |  |
| dateto | bigint | no |  | End date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time); must be greater than or equal to `datefrom` |  |
| description | text | yes | '' | Detailed general description |  |
| foreigntaxrates | json | no |  | Country-specific tax rates in percent; use country code as object key |  |

## Outbound foreign keys
- fork → forks.ID (fk_coupons_fork)
- ownergroup → groups.ID (fk_coupons_ownergroup)

## Inbound references
- couponcodes.coupon → coupons.ID (fk_couponcodes_coupon)

---

# cpu (table)

CPU usage statistics for system monitoring.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| date | bigint | yes |  |  |  |
| application | integer | no |  |  |  |
| type | smallint | yes |  |  |  |
| count | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# cpucollector (table)

Aggregated CPU metrics from the collector service.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| index | integer | yes |  |  |  |
| count | integer | yes |  |  |  |
| type | smallint | yes |  |  |  |
| start | smallint | yes |  |  |  |
| ticks | smallint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# customfields (table)

Custom field definitions for extending entity schemas.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | integer | yes |  | Custom field ID |  |
| creator | integer | no |  | Creator user ID (defaults to authenticated user on creation) |  |
| creationdate | bigint | yes | EXTRACT(epoch FROM now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | EXTRACT(epoch FROM now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| activity | smallint | yes | 0 | Activity (`0`=ACTIVE, `1`=DEACTIVATED, `2`=DELETED) |  |
| name | text | yes |  | Name |  |
| identifier | character varying(200) | no |  | Unique field identifier |  |
| context | text | yes |  | Context (mainly entity) |  |
| source | smallint | yes | 0 | Data source (`0`=EXTDATA, `1`=TAGS, `2`=INTERNAL) |  |
| reference | text | yes |  | Data reference (extdata field name or tag name) |  |
| indexed | smallint | yes | 0 | Indexed |  |
| type | text | yes | '' | Data type |  |
| entity | t_entity | no |  | Canonical entity; only for `type`=`entity` |  |
| options | json | no |  | [JSON](https://tools.ietf.org/html/rfc7159)-encoded option values and labels (array or object); only relevant for `type`=`list` |  |
| langaliases | json | no |  | [JSON](https://tools.ietf.org/html/rfc7159)-encoded language-specific aliases (object); use language code as object key |  |
| pattern | text | yes | '' |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# davids (table)

CalDAV/CardDAV sync identifiers for external calendar/contact sync.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| davserver | integer | yes |  |  | davservers.ID (fk_davids_davserver) |
| contact | integer | no |  |  | contacts.ID (fk_davids_contact) |
| appointment | integer | no |  |  | appointments.ID (fk_davids_appointment) |
| task | integer | no |  |  | tasks.ID (fk_davids_task) |
| href | text | yes |  |  |  |
| etag | text | yes | '' |  |  |
| vobject | text | yes | '' |  |  |

## Outbound foreign keys
- davserver → davservers.ID (fk_davids_davserver)
- contact → contacts.ID (fk_davids_contact)
- appointment → appointments.ID (fk_davids_appointment)
- task → tasks.ID (fk_davids_task)

## Inbound references
- (none)

---

# davservers (table)

CalDAV/CardDAV server configurations for sync.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | integer | yes |  | DAV server ID |  |
| owneruser | integer | no |  | Owner user ID (PUBLIC if `owneruser`=`null` and `ownergroup`=`null`) | users.ID (fk_davservers_owneruser) |
| ownergroup | integer | no |  | Owner group ID (PUBLIC if `owneruser`=`null` and `ownergroup`=`null`) | groups.ID (fk_davservers_ownergroup) |
| creator | integer | no |  | Creator user ID (defaults to authenticated user on creation) |  |
| creationdate | bigint | yes | date_part('epoch', now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | date_part('epoch', now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| recipientuser | integer | no |  | Recipient user ID (PUBLIC if `recipientuser`=`null` and `recipientgroup`=`null`) | users.ID (fk_davservers_recipientuser) |
| recipientgroup | integer | no |  | Recipient group ID (PUBLIC if `recipientuser`=`null` and `recipientgroup`=`null`) | groups.ID (fk_davservers_recipientgroup) |
| activity | smallint | yes | 0 | Activity (`0`=ACTIVE, `1`=DEACTIVATED, `2`=DELETED) |  |
| name | text | yes |  | Name |  |
| type | smallint | yes | 0 | Collection type (`0`=CONTACTS, `2`=APPOINTMENTS, `1`=TASKS) |  |
| url | text | yes |  | Endpoint URL |  |
| username | text | yes | '' | Username |  |
| ctag | text | yes | '' | Collection entity tag (CTag) ([caldav-ctag-03](https://github.com/apple/ccs-calendarserver/doc/Extensions/caldav-ctag.txt)) |  |
| synctoken | text | yes | '' | Synchronization token ([RFC 6578](https://tools.ietf.org/html/rfc6578#section-4)) |  |
| description | text | yes | '' | Detailed general description |  |
| password | bytea | no |  |  |  |

## Outbound foreign keys
- owneruser → users.ID (fk_davservers_owneruser)
- ownergroup → groups.ID (fk_davservers_ownergroup)
- recipientuser → users.ID (fk_davservers_recipientuser)
- recipientgroup → groups.ID (fk_davservers_recipientgroup)

## Inbound references
- appointments.davserver → davservers.ID (fk_appointments_davserver)
- contacts.davserver → davservers.ID (fk_contacts_davserver)
- davids.davserver → davservers.ID (fk_davids_davserver)
- tasks.davserver → davservers.ID (fk_tasks_davserver)

---

# devices (table)

Serialized inventory devices with charge and expiration tracking.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | integer | yes |  | Device ID |  |
| fork | integer | no |  | Fork ID (`null` for base module) | forks.ID (fk_devices_fork) |
| ownergroup | integer | no |  | Owner group ID (`null`=PUBLIC) | groups.ID (fk_devices_ownergroup) |
| creator | integer | no |  | Creator user ID (defaults to authenticated user on creation) |  |
| creationdate | bigint | yes | date_part('epoch', now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | date_part('epoch', now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| item | integer | yes |  | Item ID | items.ID (fk_devices_item) |
| contract | integer | no |  | Contract ID | contracts.ID (fk_devices_contract) |
| visibility | smallint | yes | 0 | Visibility (`0`=REGULAR, `1`=ARCHIVED, `2`=DELETED) |  |
| serialnum | text | yes | '' | Serial number; is required if `chargenum` is empty, otherwise must be empty |  |
| chargenum | text | yes | '' | Charge (lot) number; is required if `serialnum` is empty, otherwise must be empty |  |
| expdate | bigint | no |  | Expiry date as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) |  |
| description | text | yes | '' | Detailed general description |  |

## Outbound foreign keys
- fork → forks.ID (fk_devices_fork)
- ownergroup → groups.ID (fk_devices_ownergroup)
- item → items.ID (fk_devices_item)
- contract → contracts.ID (fk_devices_contract)

## Inbound references
- (none)

---

# documents (table)

Document records with versioning support.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | integer | yes |  | Document ID |  |
| fork | integer | no |  | Fork ID (`null` for base module) | forks.ID (fk_documents_fork) |
| owneruser | integer | no |  | Owner user ID (PUBLIC if `owneruser`=`null` and `ownergroup`=`null`) | users.ID (fk_documents_owneruser) |
| ownergroup | integer | no |  | Owner group ID (PUBLIC if `owneruser`=`null` and `ownergroup`=`null`) | groups.ID (fk_documents_ownergroup) |
| creator | integer | no |  | Creator user ID (defaults to authenticated user on creation) |  |
| assigneduser | integer | no |  | Assigned user ID | users.ID (fk_documents_assigneduser) |
| creationdate | bigint | yes | EXTRACT(epoch FROM now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | EXTRACT(epoch FROM now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| binfile | integer | no |  | Binary file ID; is read-only (not for `PUT` or `PATCH`) | binfiles.ID (fk_documents_binfile) |
| visibility | smallint | yes | 0 | Visibility (`0`=REGULAR, `1`=ARCHIVED, `2`=DELETED) |  |
| name | text | yes |  | Name |  |
| documentnum | text | yes | '' | Document number |  |
| status | smallint | yes | 0 | Status (`0`=DRAFT, `1`=FEEDBACKREQUIRED, `2`=INREVISION, `3`=AWAITINGAPPROVAL, `4`=FINAL, `5`=OBSOLETE) |  |
| filename | text | yes | '' | Filename |  |
| mimetype | text | yes | 'application/octet-stream' | [MIME type](https://en.wikipedia.org/wiki/Media_type) ([RFC 2045](https://tools.ietf.org/html/rfc2045)) |  |
| public | smallint | yes | 0 | Publicly accessible |  |
| description | text | yes | '' | Detailed general description |  |

## Outbound foreign keys
- fork → forks.ID (fk_documents_fork)
- owneruser → users.ID (fk_documents_owneruser)
- ownergroup → groups.ID (fk_documents_ownergroup)
- assigneduser → users.ID (fk_documents_assigneduser)
- binfile → binfiles.ID (fk_documents_binfile)

## Inbound references
- (none)

---

# dunning (table)

Payment reminder notices with dunning levels and status.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | integer | yes |  | Dunning notice ID |  |
| fork | integer | no |  | Fork ID (`null` for base module) | forks.ID (fk_dunning_fork) |
| ownergroup | integer | no |  | Owner group ID (`null`=PUBLIC) | groups.ID (fk_dunning_ownergroup) |
| creator | integer | no |  | Creator user ID (defaults to authenticated user on creation) |  |
| assigneduser | integer | no |  | Assigned user ID | users.ID (fk_dunning_assigneduser) |
| creationdate | bigint | yes | date_part('epoch', now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | date_part('epoch', now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| account | integer | no |  | Account ID | accounts.ID (fk_dunning_account) |
| dunningnum | text | yes |  | Dunning number |  |
| type | smallint | yes | 0 | Dunning type (`0`=LISTING, `1`=REMINDER, `2`=NOTICE) |  |
| date | bigint | yes | date_part('epoch', now()) | Designated date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| duedate | bigint | no |  | Due date as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) |  |
| status | smallint | yes | 0 | Status (`0`=DRAFT, `1`=BOOKED, `2`=CANCELLED, `3`=CLOSED) |  |
| fee | double precision | yes | 0 | Dunning fee |  |
| recipient | text | yes | '' | Recipient |  |
| address | text | yes | '' | Address (street and building/suite number) |  |
| postalcode | text | yes | '' | Postal or ZIP code |  |
| city | text | yes | '' | City or locality |  |
| region | text | yes | '' | Region or state |  |
| country | character varying(2) | yes | '' | Country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)) |  |

## Outbound foreign keys
- fork → forks.ID (fk_dunning_fork)
- ownergroup → groups.ID (fk_dunning_ownergroup)
- assigneduser → users.ID (fk_dunning_assigneduser)
- account → accounts.ID (fk_dunning_account)

## Inbound references
- dunning2transactions.dunning → dunning.ID (fk_dunning2transactions_dunning)

---

# dunning2transactions (table)

Junction table linking dunning notices to transactions.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | bigint | yes |  | Dunning-to-transaction ID |  |
| creator | integer | no |  | Creator user ID (defaults to authenticated user on creation) |  |
| creationdate | bigint | yes | date_part('epoch', now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | EXTRACT(epoch FROM now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| dunning | integer | yes |  | Dunning notice ID (**dependency**) | dunning.ID (fk_dunning2transactions_dunning) |
| transaction | integer | yes |  | Transaction ID (**dependency**) | transactions.ID (fk_dunning2transactions_transaction) |

## Outbound foreign keys
- dunning → dunning.ID (fk_dunning2transactions_dunning)
- transaction → transactions.ID (fk_dunning2transactions_transaction)

## Inbound references
- (none)

---

# entities2channels (table)

Junction table linking entities to communication channels.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | bigint | yes |  | Entity-to-channel ID |  |
| creator | integer | no |  | Creator user ID (defaults to authenticated user on creation) |  |
| creationdate | bigint | yes | date_part('epoch', now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | EXTRACT(epoch FROM now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| entity | t_entity | yes |  | Canonical entity |  |
| index | integer | yes |  | Entity ID |  |
| channel | integer | yes |  | Channel ID (**dependency**) | channels.ID (fk_entities2channels_channel) |

## Outbound foreign keys
- channel → channels.ID (fk_entities2channels_channel)

## Inbound references
- (none)

---

# events (table)

Timeline events linked to entities with date ranges and metadata.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | integer | yes |  | Event ID |  |
| fork | integer | no |  | Fork ID (`null` for base module); inherited from entity | forks.ID (fk_events_fork) |
| owneruser | integer | no |  | Owner user ID (PUBLIC if `owneruser`=`null` and `ownergroup`=`null`) | users.ID (fk_events_owneruser) |
| ownergroup | integer | no |  | Owner group ID (PUBLIC if `owneruser`=`null` and `ownergroup`=`null`) | groups.ID (fk_events_ownergroup) |
| creator | integer | no |  | Creator user ID (defaults to authenticated user on creation) |  |
| creationdate | bigint | yes | date_part('epoch', now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | date_part('epoch', now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| entity | t_entity | yes |  | Canonical entity |  |
| index | integer | yes |  | Entity ID |  |
| name | text | yes |  | Name |  |
| color | character varying(6) | yes | '' | Color code (CSS-style hexadecimal without `#`) |  |
| datefrom | bigint | yes |  | Start date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time); must be less than or equal to `dateto` |  |
| dateto | bigint | yes |  | End date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time); must be greater than or equal to `datefrom` |  |
| meta | json | no |  | [JSON](https://tools.ietf.org/html/rfc7159)-encoded metadata (object) |  |

## Outbound foreign keys
- fork → forks.ID (fk_events_fork)
- owneruser → users.ID (fk_events_owneruser)
- ownergroup → groups.ID (fk_events_ownergroup)

## Inbound references
- (none)

---

# extdata (view)

View joining extended data fields with their values.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| entity | t_entity | no |  |  |  |
| name | text | no |  |  |  |
| index | bigint | no |  |  |  |
| value | text | no |  |  |  |
| number | numeric | no |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataempty_accounts (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataempty_actionsteps (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataempty_applications (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataempty_appointments (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataempty_campaigns (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataempty_channels (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataempty_contacts (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataempty_contracts (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataempty_couponcodes (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataempty_coupons (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataempty_customfields (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataempty_davservers (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataempty_devices (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataempty_documents (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataempty_dunning (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataempty_feedservers (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataempty_forks (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataempty_groups (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataempty_items (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataempty_ledgers (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataempty_links (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataempty_mailinglists (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataempty_mailservers (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataempty_messages (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataempty_notes (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataempty_objects (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataempty_opportunities (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataempty_participants (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataempty_payments (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataempty_pricelists (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataempty_projects (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataempty_resources (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataempty_services (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataempty_stocktransactions (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataempty_storages (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataempty_tasks (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataempty_tickets (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataempty_transactions (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataempty_users (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataempty_weblets (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatafields (table)

Extended data field definitions for custom entity attributes.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | bigint | yes |  |  |  |
| entity | t_entity | yes |  |  |  |
| name | text | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatanumeric_accounts (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | no |  |  |  |
| number | numeric | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatanumeric_actionsteps (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | no |  |  |  |
| number | numeric | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatanumeric_applications (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | no |  |  |  |
| number | numeric | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatanumeric_appointments (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | no |  |  |  |
| number | numeric | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatanumeric_campaigns (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | no |  |  |  |
| number | numeric | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatanumeric_channels (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | no |  |  |  |
| number | numeric | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatanumeric_contacts (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | no |  |  |  |
| number | numeric | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatanumeric_contracts (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | no |  |  |  |
| number | numeric | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatanumeric_couponcodes (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | no |  |  |  |
| number | numeric | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatanumeric_coupons (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | no |  |  |  |
| number | numeric | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatanumeric_customfields (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | no |  |  |  |
| number | numeric | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatanumeric_davservers (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | no |  |  |  |
| number | numeric | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatanumeric_devices (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | no |  |  |  |
| number | numeric | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatanumeric_documents (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | no |  |  |  |
| number | numeric | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatanumeric_dunning (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | no |  |  |  |
| number | numeric | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatanumeric_feedservers (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | no |  |  |  |
| number | numeric | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatanumeric_forks (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | no |  |  |  |
| number | numeric | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatanumeric_groups (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | no |  |  |  |
| number | numeric | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatanumeric_items (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | no |  |  |  |
| number | numeric | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatanumeric_ledgers (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | no |  |  |  |
| number | numeric | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatanumeric_links (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | no |  |  |  |
| number | numeric | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatanumeric_mailinglists (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | no |  |  |  |
| number | numeric | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatanumeric_mailservers (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | no |  |  |  |
| number | numeric | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatanumeric_messages (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | no |  |  |  |
| number | numeric | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatanumeric_notes (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | no |  |  |  |
| number | numeric | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatanumeric_objects (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | no |  |  |  |
| number | numeric | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatanumeric_opportunities (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | no |  |  |  |
| number | numeric | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatanumeric_participants (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | no |  |  |  |
| number | numeric | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatanumeric_payments (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | no |  |  |  |
| number | numeric | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatanumeric_pricelists (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | no |  |  |  |
| number | numeric | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatanumeric_projects (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | no |  |  |  |
| number | numeric | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatanumeric_resources (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | no |  |  |  |
| number | numeric | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatanumeric_services (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | no |  |  |  |
| number | numeric | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatanumeric_stocktransactions (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | no |  |  |  |
| number | numeric | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatanumeric_storages (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | no |  |  |  |
| number | numeric | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatanumeric_tasks (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | no |  |  |  |
| number | numeric | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatanumeric_tickets (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | no |  |  |  |
| number | numeric | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatanumeric_transactions (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | no |  |  |  |
| number | numeric | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatanumeric_users (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | no |  |  |  |
| number | numeric | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatanumeric_weblets (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | no |  |  |  |
| number | numeric | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataregular_accounts (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataregular_actionsteps (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataregular_applications (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataregular_appointments (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataregular_campaigns (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataregular_channels (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataregular_contacts (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataregular_contracts (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataregular_couponcodes (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataregular_coupons (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataregular_customfields (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataregular_davservers (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataregular_devices (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataregular_documents (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataregular_dunning (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataregular_feedservers (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataregular_forks (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataregular_groups (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataregular_items (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataregular_ledgers (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataregular_links (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataregular_mailinglists (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataregular_mailservers (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataregular_messages (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataregular_notes (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataregular_objects (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataregular_opportunities (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataregular_participants (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataregular_payments (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataregular_pricelists (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataregular_projects (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataregular_resources (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataregular_services (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataregular_stocktransactions (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataregular_storages (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataregular_tasks (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataregular_tickets (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataregular_transactions (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataregular_users (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdataregular_weblets (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |
| value | text | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatavalues (view)

Extended data values for custom entity attributes.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| entity | t_entity | no |  |  |  |
| field | bigint | no |  |  |  |
| index | bigint | no |  |  |  |
| value | text | no |  |  |  |
| number | numeric | no |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatavalues_accounts (view)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | no |  |  |  |
| index | bigint | no |  |  |  |
| value | text | no |  |  |  |
| number | numeric | no |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatavalues_actionsteps (view)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | no |  |  |  |
| index | bigint | no |  |  |  |
| value | text | no |  |  |  |
| number | numeric | no |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatavalues_applications (view)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | no |  |  |  |
| index | bigint | no |  |  |  |
| value | text | no |  |  |  |
| number | numeric | no |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatavalues_appointments (view)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | no |  |  |  |
| index | bigint | no |  |  |  |
| value | text | no |  |  |  |
| number | numeric | no |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatavalues_campaigns (view)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | no |  |  |  |
| index | bigint | no |  |  |  |
| value | text | no |  |  |  |
| number | numeric | no |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatavalues_channels (view)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | no |  |  |  |
| index | bigint | no |  |  |  |
| value | text | no |  |  |  |
| number | numeric | no |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatavalues_contacts (view)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | no |  |  |  |
| index | bigint | no |  |  |  |
| value | text | no |  |  |  |
| number | numeric | no |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatavalues_contracts (view)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | no |  |  |  |
| index | bigint | no |  |  |  |
| value | text | no |  |  |  |
| number | numeric | no |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatavalues_couponcodes (view)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | no |  |  |  |
| index | bigint | no |  |  |  |
| value | text | no |  |  |  |
| number | numeric | no |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatavalues_coupons (view)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | no |  |  |  |
| index | bigint | no |  |  |  |
| value | text | no |  |  |  |
| number | numeric | no |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatavalues_customfields (view)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | no |  |  |  |
| index | bigint | no |  |  |  |
| value | text | no |  |  |  |
| number | numeric | no |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatavalues_davservers (view)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | no |  |  |  |
| index | bigint | no |  |  |  |
| value | text | no |  |  |  |
| number | numeric | no |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatavalues_devices (view)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | no |  |  |  |
| index | bigint | no |  |  |  |
| value | text | no |  |  |  |
| number | numeric | no |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatavalues_documents (view)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | no |  |  |  |
| index | bigint | no |  |  |  |
| value | text | no |  |  |  |
| number | numeric | no |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatavalues_dunning (view)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | no |  |  |  |
| index | bigint | no |  |  |  |
| value | text | no |  |  |  |
| number | numeric | no |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatavalues_feedservers (view)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | no |  |  |  |
| index | bigint | no |  |  |  |
| value | text | no |  |  |  |
| number | numeric | no |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatavalues_forks (view)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | no |  |  |  |
| index | bigint | no |  |  |  |
| value | text | no |  |  |  |
| number | numeric | no |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatavalues_groups (view)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | no |  |  |  |
| index | bigint | no |  |  |  |
| value | text | no |  |  |  |
| number | numeric | no |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatavalues_items (view)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | no |  |  |  |
| index | bigint | no |  |  |  |
| value | text | no |  |  |  |
| number | numeric | no |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatavalues_ledgers (view)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | no |  |  |  |
| index | bigint | no |  |  |  |
| value | text | no |  |  |  |
| number | numeric | no |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatavalues_links (view)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | no |  |  |  |
| index | bigint | no |  |  |  |
| value | text | no |  |  |  |
| number | numeric | no |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatavalues_mailinglists (view)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | no |  |  |  |
| index | bigint | no |  |  |  |
| value | text | no |  |  |  |
| number | numeric | no |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatavalues_mailservers (view)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | no |  |  |  |
| index | bigint | no |  |  |  |
| value | text | no |  |  |  |
| number | numeric | no |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatavalues_messages (view)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | no |  |  |  |
| index | bigint | no |  |  |  |
| value | text | no |  |  |  |
| number | numeric | no |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatavalues_notes (view)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | no |  |  |  |
| index | bigint | no |  |  |  |
| value | text | no |  |  |  |
| number | numeric | no |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatavalues_objects (view)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | no |  |  |  |
| index | bigint | no |  |  |  |
| value | text | no |  |  |  |
| number | numeric | no |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatavalues_opportunities (view)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | no |  |  |  |
| index | bigint | no |  |  |  |
| value | text | no |  |  |  |
| number | numeric | no |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatavalues_participants (view)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | no |  |  |  |
| index | bigint | no |  |  |  |
| value | text | no |  |  |  |
| number | numeric | no |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatavalues_payments (view)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | no |  |  |  |
| index | bigint | no |  |  |  |
| value | text | no |  |  |  |
| number | numeric | no |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatavalues_pricelists (view)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | no |  |  |  |
| index | bigint | no |  |  |  |
| value | text | no |  |  |  |
| number | numeric | no |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatavalues_projects (view)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | no |  |  |  |
| index | bigint | no |  |  |  |
| value | text | no |  |  |  |
| number | numeric | no |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatavalues_resources (view)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | no |  |  |  |
| index | bigint | no |  |  |  |
| value | text | no |  |  |  |
| number | numeric | no |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatavalues_services (view)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | no |  |  |  |
| index | bigint | no |  |  |  |
| value | text | no |  |  |  |
| number | numeric | no |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatavalues_stocktransactions (view)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | no |  |  |  |
| index | bigint | no |  |  |  |
| value | text | no |  |  |  |
| number | numeric | no |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatavalues_storages (view)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | no |  |  |  |
| index | bigint | no |  |  |  |
| value | text | no |  |  |  |
| number | numeric | no |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatavalues_tasks (view)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | no |  |  |  |
| index | bigint | no |  |  |  |
| value | text | no |  |  |  |
| number | numeric | no |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatavalues_tickets (view)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | no |  |  |  |
| index | bigint | no |  |  |  |
| value | text | no |  |  |  |
| number | numeric | no |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatavalues_transactions (view)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | no |  |  |  |
| index | bigint | no |  |  |  |
| value | text | no |  |  |  |
| number | numeric | no |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatavalues_users (view)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | no |  |  |  |
| index | bigint | no |  |  |  |
| value | text | no |  |  |  |
| number | numeric | no |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatavalues_weblets (view)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | no |  |  |  |
| index | bigint | no |  |  |  |
| value | text | no |  |  |  |
| number | numeric | no |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatazero_accounts (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatazero_actionsteps (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatazero_applications (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatazero_appointments (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatazero_campaigns (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatazero_channels (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatazero_contacts (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatazero_contracts (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatazero_couponcodes (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatazero_coupons (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatazero_customfields (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatazero_davservers (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatazero_devices (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatazero_documents (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatazero_dunning (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatazero_feedservers (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatazero_forks (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatazero_groups (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatazero_items (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatazero_ledgers (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatazero_links (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatazero_mailinglists (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatazero_mailservers (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatazero_messages (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatazero_notes (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatazero_objects (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatazero_opportunities (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatazero_participants (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatazero_payments (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatazero_pricelists (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatazero_projects (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatazero_resources (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatazero_services (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatazero_stocktransactions (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatazero_storages (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatazero_tasks (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatazero_tickets (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatazero_transactions (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatazero_users (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# extdatazero_weblets (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| field | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# feedids (table)

RSS/Atom feed item identifiers for deduplication.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| feedserver | integer | yes |  |  | feedservers.ID (fk_feedids_feedserver) |
| record | bigint | no |  |  | records.ID (fk_feedids_record) |
| uuid | text | yes |  |  |  |

## Outbound foreign keys
- feedserver → feedservers.ID (fk_feedids_feedserver)
- record → records.ID (fk_feedids_record)

## Inbound references
- (none)

---

# feedservers (table)

RSS/Atom feed server configurations.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | integer | yes |  | Feed server ID |  |
| owneruser | integer | no |  | Owner user ID (PUBLIC if `owneruser`=`null` and `ownergroup`=`null`) | users.ID (fk_feedservers_owneruser) |
| ownergroup | integer | no |  | Owner group ID (PUBLIC if `owneruser`=`null` and `ownergroup`=`null`) | groups.ID (fk_feedservers_ownergroup) |
| creator | integer | no |  | Creator user ID (defaults to authenticated user on creation) |  |
| creationdate | bigint | yes | date_part('epoch', now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | date_part('epoch', now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| recipientuser | integer | no |  | Recipient user ID (PUBLIC if `recipientuser`=`null` and `recipientgroup`=`null`) | users.ID (fk_feedservers_recipientuser) |
| recipientgroup | integer | no |  | Recipient group ID (PUBLIC if `recipientuser`=`null` and `recipientgroup`=`null`) | groups.ID (fk_feedservers_recipientgroup) |
| channel | integer | no |  | Channel ID | channels.ID (fk_feedservers_channel) |
| activity | smallint | yes | 0 | Activity (`0`=ACTIVE, `1`=DEACTIVATED, `2`=DELETED) |  |
| name | text | yes |  | Name |  |
| url | text | yes |  | Feed URL |  |
| username | text | yes | '' | Username |  |
| notify | smallint | yes | 0 | Notify about new records |  |
| etag | text | yes | '' | Entity tag (ETag) ([RFC 7232](https://tools.ietf.org/html/rfc7232#section-2.3)) |  |
| description | text | yes | '' | Detailed general description |  |
| password | bytea | no |  |  |  |

## Outbound foreign keys
- owneruser → users.ID (fk_feedservers_owneruser)
- ownergroup → groups.ID (fk_feedservers_ownergroup)
- recipientuser → users.ID (fk_feedservers_recipientuser)
- recipientgroup → groups.ID (fk_feedservers_recipientgroup)
- channel → channels.ID (fk_feedservers_channel)

## Inbound references
- feedids.feedserver → feedservers.ID (fk_feedids_feedserver)

---

# files (table)

File attachments linked to records or comments.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | bigint | yes |  | File ID |  |
| creator | integer | no |  | Creator user ID (defaults to authenticated user on creation) |  |
| creationdate | bigint | yes | date_part('epoch', now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | EXTRACT(epoch FROM now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| record | bigint | no |  | Record ID (**dependency**); is mutually exclusive to `comment` (either one is required) | records.ID (fk_files_record) |
| comment | bigint | no |  | Comment ID (**dependency**); is mutually exclusive to `record` (either one is required) | comments.ID (fk_files_comment) |
| binfile | integer | no |  | Binary file ID; is read-only (not for `PUT` or `PATCH`) | binfiles.ID (fk_files_binfile) |
| filename | text | yes | '' | Filename |  |
| mimetype | text | yes | 'application/octet-stream' | [MIME type](https://en.wikipedia.org/wiki/Media_type) ([RFC 2045](https://tools.ietf.org/html/rfc2045)) |  |

## Outbound foreign keys
- record → records.ID (fk_files_record)
- comment → comments.ID (fk_files_comment)
- binfile → binfiles.ID (fk_files_binfile)

## Inbound references
- (none)

---

# follows (table)

User follows for entity notifications.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | bigint | yes |  | Follow ID |  |
| creator | integer | yes |  | Creator user ID (defaults to authenticated user on creation) | users.ID (fk_follows_creator) |
| creationdate | bigint | yes | date_part('epoch', now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | EXTRACT(epoch FROM now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| entity | t_entity | yes |  | Canonical entity |  |
| index | bigint | yes |  | Entity ID |  |

## Outbound foreign keys
- creator → users.ID (fk_follows_creator)

## Inbound references
- (none)

---

# forks (table)

Database fork configurations for multi-tenant setups.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | integer | yes |  | Fork ID |  |
| creator | integer | no |  | Creator user ID (defaults to authenticated user on creation) |  |
| creationdate | bigint | yes | EXTRACT(epoch FROM now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | EXTRACT(epoch FROM now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| group | integer | no |  | Group ID | groups.ID (fk_forks_group) |
| activity | smallint | yes | 0 | Activity (`0`=ACTIVE, `1`=DEACTIVATED, `2`=DELETED) |  |
| name | text | yes |  | Name |  |
| identifier | character varying(200) | yes |  | Unique fork identifier |  |
| module | text | yes |  | Canonical module identifier |  |
| color | character varying(6) | yes | '' | Color code (CSS-style hexadecimal without `#`) |  |
| langaliases | json | no |  | [JSON](https://tools.ietf.org/html/rfc7159)-encoded language-specific aliases (object); use language code as object key |  |
| description | text | yes | '' |  |  |
| settings | json | no |  |  |  |

## Outbound foreign keys
- group → groups.ID (fk_forks_group)

## Inbound references
- accounts.fork → forks.ID (fk_accounts_fork)
- actionsteps.fork → forks.ID (fk_actionsteps_fork)
- appointments.fork → forks.ID (fk_appointments_fork)
- campaigns.fork → forks.ID (fk_campaigns_fork)
- categories.fork → forks.ID (fk_categories_fork)
- contacts.fork → forks.ID (fk_contacts_fork)
- contracts.fork → forks.ID (fk_contracts_fork)
- coupons.fork → forks.ID (fk_coupons_fork)
- devices.fork → forks.ID (fk_devices_fork)
- documents.fork → forks.ID (fk_documents_fork)
- dunning.fork → forks.ID (fk_dunning_fork)
- events.fork → forks.ID (fk_events_fork)
- items.fork → forks.ID (fk_items_fork)
- ledgers.fork → forks.ID (fk_ledgers_fork)
- links.fork → forks.ID (fk_links_fork)
- mailinglists.fork → forks.ID (fk_mailinglists_fork)
- messages.fork → forks.ID (fk_messages_fork)
- notes.fork → forks.ID (fk_notes_fork)
- objects.fork → forks.ID (fk_objects_fork)
- opportunities.fork → forks.ID (fk_opportunities_fork)
- payments.fork → forks.ID (fk_payments_fork)
- permissions.fork → forks.ID (fk_permissions_fork)
- pricelists.fork → forks.ID (fk_pricelists_fork)
- projects.fork → forks.ID (fk_projects_fork)
- records.fork → forks.ID (fk_records_fork)
- storages.fork → forks.ID (fk_storages_fork)
- tasks.fork → forks.ID (fk_tasks_fork)
- tickets.fork → forks.ID (fk_tickets_fork)
- transactions.fork → forks.ID (fk_transactions_fork)
- userfields.fork → forks.ID (fk_userfields_fork)
- userfilters.fork → forks.ID (fk_userfilters_fork)

---

# groups (table)

User groups for permission management and ownership.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | integer | yes |  | Group ID |  |
| creator | integer | no |  | Creator user ID (defaults to authenticated user on creation) |  |
| creationdate | bigint | yes | date_part('epoch', now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | date_part('epoch', now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| leader | integer | no |  | Leader user ID | users.ID (fk_groups_leader) |
| activity | smallint | yes | 0 | Activity (`0`=ACTIVE, `1`=DEACTIVATED, `2`=DELETED) |  |
| name | text | yes |  | Name (case-insensitively unique) |  |
| description | text | yes | '' |  |  |

## Outbound foreign keys
- leader → users.ID (fk_groups_leader)

## Inbound references
- accounts.ownergroup → groups.ID (fk_accounts_ownergroup)
- actionsteps.ownergroup → groups.ID (fk_actionsteps_ownergroup)
- appointments.ownergroup → groups.ID (fk_appointments_ownergroup)
- campaigns.ownergroup → groups.ID (fk_campaigns_ownergroup)
- categories.ownergroup → groups.ID (fk_categories_ownergroup)
- channels.ownergroup → groups.ID (fk_channels_ownergroup)
- contacts.ownergroup → groups.ID (fk_contacts_ownergroup)
- contracts.ownergroup → groups.ID (fk_contracts_ownergroup)
- coupons.ownergroup → groups.ID (fk_coupons_ownergroup)
- davservers.ownergroup → groups.ID (fk_davservers_ownergroup)
- davservers.recipientgroup → groups.ID (fk_davservers_recipientgroup)
- devices.ownergroup → groups.ID (fk_devices_ownergroup)
- documents.ownergroup → groups.ID (fk_documents_ownergroup)
- dunning.ownergroup → groups.ID (fk_dunning_ownergroup)
- events.ownergroup → groups.ID (fk_events_ownergroup)
- feedservers.ownergroup → groups.ID (fk_feedservers_ownergroup)
- feedservers.recipientgroup → groups.ID (fk_feedservers_recipientgroup)
- forks.group → groups.ID (fk_forks_group)
- groups2users.group → groups.ID (fk_groups2users_group)
- items.ownergroup → groups.ID (fk_items_ownergroup)
- ledgers.ownergroup → groups.ID (fk_ledgers_ownergroup)
- links.ownergroup → groups.ID (fk_links_ownergroup)
- mailinglists.ownergroup → groups.ID (fk_mailinglists_ownergroup)
- mailservers.ownergroup → groups.ID (fk_mailservers_ownergroup)
- mailservers.recipientgroup → groups.ID (fk_mailservers_recipientgroup)
- messages.ownergroup → groups.ID (fk_messages_ownergroup)
- notes.ownergroup → groups.ID (fk_notes_ownergroup)
- objects.ownergroup → groups.ID (fk_objects_ownergroup)
- opportunities.ownergroup → groups.ID (fk_opportunities_ownergroup)
- payments.ownergroup → groups.ID (fk_payments_ownergroup)
- permissions.group → groups.ID (fk_permissions_group)
- pricelists.ownergroup → groups.ID (fk_pricelists_ownergroup)
- projects.ownergroup → groups.ID (fk_projects_ownergroup)
- records.ownergroup → groups.ID (fk_records_ownergroup)
- storages.ownergroup → groups.ID (fk_storages_ownergroup)
- tasks.ownergroup → groups.ID (fk_tasks_ownergroup)
- tickets.ownergroup → groups.ID (fk_tickets_ownergroup)
- transactions.ownergroup → groups.ID (fk_transactions_ownergroup)

---

# groups2users (table)

Junction table linking users to groups with write permissions.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | bigint | yes |  | Group-to-user ID |  |
| creator | integer | no |  | Creator user ID (defaults to authenticated user on creation) |  |
| creationdate | bigint | yes | date_part('epoch', now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | date_part('epoch', now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| group | integer | yes |  | Group ID (**dependency**) | groups.ID (fk_groups2users_group) |
| user | integer | yes |  | User ID (**dependency**) | users.ID (fk_groups2users_user) |
| writable | smallint | yes | 0 | Allow writing of group-owned data by user |  |

## Outbound foreign keys
- group → groups.ID (fk_groups2users_group)
- user → users.ID (fk_groups2users_user)

## Inbound references
- (none)

---

# imapids (table)

IMAP message identifiers for email deduplication.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| mailserver | integer | yes |  |  | mailservers.ID (fk_imapids_mailserver) |
| message | integer | no |  |  | messages.ID (fk_imapids_message) |
| uidvalidity | bigint | yes |  |  |  |
| uid | bigint | yes |  |  |  |
| size | integer | yes | 0 |  |  |
| date | bigint | yes |  |  |  |
| mailbox | text | yes |  |  |  |

## Outbound foreign keys
- mailserver → mailservers.ID (fk_imapids_mailserver)
- message → messages.ID (fk_imapids_message)

## Inbound references
- (none)

---

# imports (table)

Saved import configurations for data migration.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| user | integer | yes |  |  | users.ID (fk_imports_user) |
| date | bigint | yes |  |  |  |
| name | text | yes |  |  |  |
| settings | json | yes |  |  |  |
| entity | text | yes |  |  |  |

## Outbound foreign keys
- user → users.ID (fk_imports_user)

## Inbound references
- (none)

---

# invitations (table)

Appointment invitations with contact and response status.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | bigint | yes |  | Invitation ID |  |
| creator | integer | no |  | Creator user ID (defaults to authenticated user on creation) |  |
| creationdate | bigint | yes | date_part('epoch', now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | date_part('epoch', now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| appointment | integer | yes |  | Appointment ID (**dependency**) | appointments.ID (fk_invitations_appointment) |
| contact | integer | no |  | Contact ID | contacts.ID (fk_invitations_contact) |
| name | text | yes |  | Name |  |
| email | text | yes | '' | E-mail address |  |
| flag | smallint | yes | 0 | Flag (`0`=UNANSWERED, `1`=CONFIRMED, `2`=REJECTED) |  |

## Outbound foreign keys
- appointment → appointments.ID (fk_invitations_appointment)
- contact → contacts.ID (fk_invitations_contact)

## Inbound references
- (none)

---

# items (table)

Inventory items with pricing, barcodes, and stock settings.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | integer | yes |  | Item ID |  |
| fork | integer | no |  | Fork ID (`null` for base module) | forks.ID (fk_items_fork) |
| ownergroup | integer | no |  | Owner group ID (`null`=PUBLIC) | groups.ID (fk_items_ownergroup) |
| creator | integer | no |  | Creator user ID (defaults to authenticated user on creation) |  |
| creationdate | bigint | yes | date_part('epoch', now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | date_part('epoch', now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| model | integer | no |  | Model item ID; only for non-MODEL | items.ID (fk_items_model) |
| picbinfile | integer | no |  | Binary file ID; is read-only (not for `PUT` or `PATCH`) | binfiles.ID (fk_items_picbinfile) |
| visibility | smallint | yes | 0 | Visibility (`0`=REGULAR, `1`=ARCHIVED, `2`=DELETED) |  |
| name | text | yes |  | Product name |  |
| manufacturer | text | yes | '' | Manufacturer (brand or company name) |  |
| itemnum | text | yes | '' | Item number (SKU) |  |
| barcode | text | yes | '' | Barcode (e.g. GTIN, EAN or UPC code) |  |
| type | smallint | yes | 0 | Item type (`0`=SIMPLE, `1`=SERIALS, `2`=CHARGES, `3`=SERIALSANDCHARGES, `4`=SET, `5`=CONTAINER, `6`=NOSTOCK, `7`=MODEL) |  |
| forcestock | smallint | no |  | Force stock check on depletion (`0`=STORAGE, `1`=LOCATION) |  |
| applicability | smallint | yes | 0 | Applicability (`0`=ALWAYS, `1`=NEVER, `2`=BILLINGONLY, `3`=PROCUREMENTONLY) |  |
| unit | character varying(3) | yes | '' | Unit code as defined by ([UN/CEFACT Recommendation 20](https://unece.org/trade/uncefact/cl-recommendations)) |  |
| sellingprice | double precision | yes | 0 | Default selling price per unit |  |
| purchaseprice | double precision | yes | 0 | Default purchase price per unit |  |
| taxrate | double precision | no |  | Tax rate in percent |  |
| weight | double precision | yes | 0 | Shipping weight per unit in kilograms |  |
| classcode | text | yes | '' | Product classification code (e.g. GPC, CPV or UNSPSC code) |  |
| tariffcode | text | yes | '' | Tariff code (e.g. HS, CN or HTS code) |  |
| origin | character varying(2) | yes | '' | Origin country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)) |  |
| description | text | yes | '' | Detailed general description |  |
| foreigntaxrates | json | no |  | Country-specific tax rates in percent; use country code as object key |  |

## Outbound foreign keys
- fork → forks.ID (fk_items_fork)
- ownergroup → groups.ID (fk_items_ownergroup)
- model → items.ID (fk_items_model)
- picbinfile → binfiles.ID (fk_items_picbinfile)

## Inbound references
- components.component → items.ID (fk_components_component)
- components.item → items.ID (fk_components_item)
- devices.item → items.ID (fk_devices_item)
- items.model → items.ID (fk_items_model)
- prices.item → items.ID (fk_prices_item)
- relateditems.item → items.ID (fk_relateditems_item)
- relateditems.relateditem → items.ID (fk_relateditems_relateditem)
- stocktransactions.item → items.ID (fk_stocktransactions_item)
- suppliers.item → items.ID (fk_suppliers_item)
- transactions.item → items.ID (fk_transactions_item)

---

# ledgers (table)

Financial ledgers for payment categorization.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | integer | yes |  | Ledger ID |  |
| fork | integer | no |  | Fork ID (`null` for base module) | forks.ID (fk_ledgers_fork) |
| ownergroup | integer | no |  | Owner group ID (`null`=PUBLIC) | groups.ID (fk_ledgers_ownergroup) |
| creator | integer | no |  | Creator user ID (defaults to authenticated user on creation) |  |
| creationdate | bigint | yes | date_part('epoch', now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | date_part('epoch', now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| visibility | smallint | yes | 0 | Visibility (`0`=REGULAR, `1`=ARCHIVED, `2`=DELETED) |  |
| name | text | yes |  | Name |  |
| description | text | yes | '' | Detailed general description |  |

## Outbound foreign keys
- fork → forks.ID (fk_ledgers_fork)
- ownergroup → groups.ID (fk_ledgers_ownergroup)

## Inbound references
- payments.ledger → ledgers.ID (fk_payments_ledger)

---

# likes (table)

User likes on activity records.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | bigint | yes |  | Like ID |  |
| creator | integer | yes |  | Creator user ID (defaults to authenticated user on creation) | users.ID (fk_likes_creator) |
| creationdate | bigint | yes | date_part('epoch', now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | EXTRACT(epoch FROM now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| record | bigint | yes |  | Record ID (**dependency**) | records.ID (fk_likes_record) |

## Outbound foreign keys
- creator → users.ID (fk_likes_creator)
- record → records.ID (fk_likes_record)

## Inbound references
- (none)

---

# links (table)

Bookmarked URLs with credentials and visit tracking.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | integer | yes |  | Link ID |  |
| fork | integer | no |  | Fork ID (`null` for base module) | forks.ID (fk_links_fork) |
| owneruser | integer | no |  | Owner user ID (PUBLIC if `owneruser`=`null` and `ownergroup`=`null`) | users.ID (fk_links_owneruser) |
| ownergroup | integer | no |  | Owner group ID (PUBLIC if `owneruser`=`null` and `ownergroup`=`null`) | groups.ID (fk_links_ownergroup) |
| creator | integer | no |  | Creator user ID (defaults to authenticated user on creation) |  |
| assigneduser | integer | no |  | Assigned user ID | users.ID (fk_links_assigneduser) |
| creationdate | bigint | yes | date_part('epoch', now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | date_part('epoch', now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| visibility | smallint | yes | 0 | Visibility (`0`=REGULAR, `1`=ARCHIVED, `2`=DELETED) |  |
| name | text | yes |  | Name |  |
| url | text | yes | '' | URL |  |
| expdate | bigint | no |  | Expiry date as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) |  |
| username | text | yes | '' | Username |  |
| password | text | yes | '' | Password (empty if encrypted) |  |
| visits | integer | yes | 0 | Number of visits |  |
| description | text | yes | '' | Detailed general description |  |
| password_encrypted | bytea | no |  |  |  |
| otpsecret | bytea | no |  |  |  |

## Outbound foreign keys
- fork → forks.ID (fk_links_fork)
- owneruser → users.ID (fk_links_owneruser)
- ownergroup → groups.ID (fk_links_ownergroup)
- assigneduser → users.ID (fk_links_assigneduser)

## Inbound references
- (none)

---

# logins (table)

User login session records.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| user | integer | yes |  |  |  |
| status | smallint | yes |  |  |  |
| date | bigint | yes |  |  |  |
| logoutdate | bigint | no |  |  |  |
| sessionid | bytea | no |  |  |  |
| ip | bytea | no |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# mailinglists (table)

Email mailing lists with sender and campaign associations.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | integer | yes |  | Mailing list ID |  |
| fork | integer | no |  | Fork ID (`null` for base module) | forks.ID (fk_mailinglists_fork) |
| owneruser | integer | no |  | Owner user ID (PUBLIC if `owneruser`=`null` and `ownergroup`=`null`) | users.ID (fk_mailinglists_owneruser) |
| ownergroup | integer | no |  | Owner group ID (PUBLIC if `owneruser`=`null` and `ownergroup`=`null`) | groups.ID (fk_mailinglists_ownergroup) |
| creator | integer | no |  | Creator user ID (defaults to authenticated user on creation) |  |
| assigneduser | integer | no |  | Assigned user ID | users.ID (fk_mailinglists_assigneduser) |
| creationdate | bigint | yes | date_part('epoch', now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | date_part('epoch', now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| campaign | integer | no |  | Campaign ID | campaigns.ID (fk_mailinglists_campaign) |
| visibility | smallint | yes | 0 | Visibility (`0`=REGULAR, `1`=ARCHIVED, `2`=DELETED) |  |
| name | text | yes |  | Name |  |
| sender | text | yes | '' | Sender name and e-mail address |  |
| description | text | yes | '' | Detailed general description |  |

## Outbound foreign keys
- fork → forks.ID (fk_mailinglists_fork)
- owneruser → users.ID (fk_mailinglists_owneruser)
- ownergroup → groups.ID (fk_mailinglists_ownergroup)
- assigneduser → users.ID (fk_mailinglists_assigneduser)
- campaign → campaigns.ID (fk_mailinglists_campaign)

## Inbound references
- messages.mailinglist → mailinglists.ID (fk_messages_mailinglist)
- participants.mailinglist → mailinglists.ID (fk_participants_mailinglist)

---

# mailingrecipients (table)

Recipients for mailing list campaigns.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | bigint | yes |  | Mailing recipient ID |  |
| creator | integer | no |  | Creator user ID (defaults to authenticated user on creation) |  |
| creationdate | bigint | yes | date_part('epoch', now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | EXTRACT(epoch FROM now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| message | integer | yes |  | Message ID (**dependency**) | messages.ID (fk_mailingrecipients_message) |
| participant | bigint | no |  | Participant ID | participants.ID (fk_mailingrecipients_participant) |
| email | text | yes |  | E-mail address |  |

## Outbound foreign keys
- message → messages.ID (fk_mailingrecipients_message)
- participant → participants.ID (fk_mailingrecipients_participant)

## Inbound references
- (none)

---

# mailservers (table)

Email server configurations for sending and receiving.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | integer | yes |  | Mail server ID |  |
| owneruser | integer | no |  | Owner user ID (PUBLIC if `owneruser`=`null` and `ownergroup`=`null`) | users.ID (fk_mailservers_owneruser) |
| ownergroup | integer | no |  | Owner group ID (PUBLIC if `owneruser`=`null` and `ownergroup`=`null`) | groups.ID (fk_mailservers_ownergroup) |
| creator | integer | no |  | Creator user ID (defaults to authenticated user on creation) |  |
| creationdate | bigint | yes | date_part('epoch', now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | date_part('epoch', now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| recipientuser | integer | no |  | Recipient user ID (PUBLIC if `recipientuser`=`null` and `recipientgroup`=`null`) | users.ID (fk_mailservers_recipientuser) |
| recipientgroup | integer | no |  | Recipient group ID (PUBLIC if `recipientuser`=`null` and `recipientgroup`=`null`) | groups.ID (fk_mailservers_recipientgroup) |
| autoreplybinfile | integer | no |  | Binary file ID; is read-only (not for `PUT` or `PATCH`) | binfiles.ID (fk_mailservers_autoreplybinfile) |
| signaturebinfile | integer | no |  | Binary file ID; is read-only (not for `PUT` or `PATCH`) | binfiles.ID (fk_mailservers_signaturebinfile) |
| activity | smallint | yes | 0 | Activity (`0`=ACTIVE, `1`=DEACTIVATED, `2`=DELETED) |  |
| name | text | yes |  | Name |  |
| sender | text | yes | '' | Sender name and e-mail address |  |
| serverin | text | yes | '' | Server (Inbound) |  |
| usernamein | text | yes | '' | Username (Inbound) |  |
| serverout | text | yes | '' | Server (Outbound) |  |
| usernameout | text | yes | '' | Username (Outbound) |  |
| description | text | yes | '' | Detailed general description |  |
| ticketing | json | no |  | [JSON](https://tools.ietf.org/html/rfc7159)-encoded ticketing data (object) |  |
| folders | json | no |  | [JSON](https://tools.ietf.org/html/rfc7159)-encoded IMAP folders (object) |  |
| passwordin | bytea | no |  |  |  |
| passwordout | bytea | no |  |  |  |

## Outbound foreign keys
- owneruser → users.ID (fk_mailservers_owneruser)
- ownergroup → groups.ID (fk_mailservers_ownergroup)
- recipientuser → users.ID (fk_mailservers_recipientuser)
- recipientgroup → groups.ID (fk_mailservers_recipientgroup)
- autoreplybinfile → binfiles.ID (fk_mailservers_autoreplybinfile)
- signaturebinfile → binfiles.ID (fk_mailservers_signaturebinfile)

## Inbound references
- imapids.mailserver → mailservers.ID (fk_imapids_mailserver)
- messages.mailserver → mailservers.ID (fk_messages_mailserver)

---

# messagereads (table)

Read receipts for messages by user.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | bigint | yes |  | Message-read ID |  |
| creator | integer | yes |  | Creator user ID (defaults to authenticated user on creation) | users.ID (fk_messagereads_creator) |
| creationdate | bigint | yes | date_part('epoch', now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | EXTRACT(epoch FROM now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| message | integer | yes |  | Message ID (**dependency**) | messages.ID (fk_messagereads_message) |

## Outbound foreign keys
- creator → users.ID (fk_messagereads_creator)
- message → messages.ID (fk_messagereads_message)

## Inbound references
- (none)

---

# messages (table)

Email messages with threading, attachments, and ticket linking.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | integer | yes |  | Message ID |  |
| fork | integer | no |  | Fork ID (`null` for base module) | forks.ID (fk_messages_fork) |
| owneruser | integer | no |  | Owner user ID (PUBLIC if `owneruser`=`null` and `ownergroup`=`null`) | users.ID (fk_messages_owneruser) |
| ownergroup | integer | no |  | Owner group ID (PUBLIC if `owneruser`=`null` and `ownergroup`=`null`) | groups.ID (fk_messages_ownergroup) |
| creator | integer | no |  | Creator user ID (defaults to authenticated user on creation) |  |
| creationdate | bigint | yes | date_part('epoch', now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | date_part('epoch', now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| mailserver | integer | no |  | Mail server ID | mailservers.ID (fk_messages_mailserver) |
| ticket | integer | no |  | Ticket ID; is mutually exclusive to `opportunity` | tickets.ID (fk_messages_ticket) |
| opportunity | integer | no |  | Opportunity ID; is mutually exclusive to `ticket` | opportunities.ID (fk_messages_opportunity) |
| mailinglist | integer | no |  | Mailing list ID | mailinglists.ID (fk_messages_mailinglist) |
| reference | integer | no |  | Reference message (reply-to) ID; must be distinct from `ID` | messages.ID (fk_messages_reference) |
| binfile | integer | no |  | Binary file ID; is read-only (not for `PUT` or `PATCH`) | binfiles.ID (fk_messages_binfile) |
| mailbox | smallint | yes | 0 | Type (`0`=INBOX, `1`=DRAFTS, `2`=SENT, `3`=TEMPLATES, `4`=MAILINGS, `5`=ARCHIVE, `6`=TRASH, `7`=JUNK) |  |
| verified | smallint | yes | 0 | Verified sender e-mail address |  |
| date | bigint | yes | date_part('epoch', now()) | Designated date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| subject | text | yes | '' | Subject |  |
| sender | text | yes | '' | Sender name and e-mail address |  |
| sender_email | text | yes | '' | Sender e-mail address |  |
| sender_name | text | yes | '' | Sender name |  |
| to | text | yes | '' | All regular recipient names and e-mail addresses |  |
| to_email | text | yes | '' | First regular recipient e-mail address |  |
| to_name | text | yes | '' | First regular recipient name |  |
| to_count | integer | yes | 0 | Number of regular recipients |  |
| cc | text | yes | '' | All carbon copy recipient names and e-mail addresses |  |
| bcc | text | yes | '' | All blind carbon copy recipient names and e-mail addresses |  |
| contenttype | text | yes | '' | Content [MIME type](https://en.wikipedia.org/wiki/Media_type) ([RFC 2045](https://tools.ietf.org/html/rfc2045)) |  |
| text | text | yes | '' | Plain text version of content |  |
| attachments | text[] | no |  | [Array](https://www.postgresql.org/docs/current/arrays.html)-encoded attachments (filenames) |  |
| senddate | bigint | no |  | Scheduled send date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) |  |
| senderror | text | yes | '' | Last error message from failure to send |  |
| messageid | text | yes | '' |  |  |

## Outbound foreign keys
- fork → forks.ID (fk_messages_fork)
- owneruser → users.ID (fk_messages_owneruser)
- ownergroup → groups.ID (fk_messages_ownergroup)
- mailserver → mailservers.ID (fk_messages_mailserver)
- ticket → tickets.ID (fk_messages_ticket)
- opportunity → opportunities.ID (fk_messages_opportunity)
- mailinglist → mailinglists.ID (fk_messages_mailinglist)
- reference → messages.ID (fk_messages_reference)
- binfile → binfiles.ID (fk_messages_binfile)

## Inbound references
- imapids.message → messages.ID (fk_imapids_message)
- mailingrecipients.message → messages.ID (fk_mailingrecipients_message)
- messagereads.message → messages.ID (fk_messagereads_message)
- messages.reference → messages.ID (fk_messages_reference)

---

# meta_cities (table)

World cities with coordinates and population data.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | integer | yes |  |  |  |
| state | smallint | yes |  |  | meta_states.ID (fk_meta_cities_state) |
| name | text | yes |  |  |  |
| wikidataid | text | yes |  |  |  |
| latitude | double precision | yes |  |  |  |
| longitude | double precision | yes |  |  |  |

## Outbound foreign keys
- state → meta_states.ID (fk_meta_cities_state)

## Inbound references
- (none)

---

# meta_countries (table)

ISO country codes with regional and currency data.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | smallint | yes |  |  |  |
| subregion | smallint | no |  |  | meta_subregions.ID (fk_meta_countries_subregion) |
| currency | smallint | no |  |  | meta_currencies.ID (fk_meta_countries_currency) |
| tld | smallint | no |  |  | meta_tlds.ID (fk_meta_countries_tld) |
| iso_alpha2 | character varying(2) | yes |  |  |  |
| iso_alpha3 | character varying(3) | yes |  |  |  |
| iso_numeric | character varying(3) | yes |  |  |  |
| edgar | character varying(2) | no |  |  |  |
| fifa | character varying(4) | no |  |  |  |
| fips | character varying(4) | no |  |  |  |
| ioc | character varying(3) | no |  |  |  |
| itu | character varying(3) | no |  |  |  |
| m49 | character varying(3) | no |  |  |  |
| marc | text | no |  |  |  |
| vri | character varying(3) | no |  |  |  |
| wmo | character varying(2) | no |  |  |  |
| geonameid | integer | yes |  |  |  |
| wikidataid | text | yes |  |  |  |
| independent | boolean | yes |  |  |  |
| un | boolean | yes |  |  |  |
| ldc | boolean | yes |  |  |  |
| lldc | boolean | yes |  |  |  |
| sids | boolean | yes |  |  |  |
| flag | text | yes |  |  |  |
| latitude | double precision | yes |  |  |  |
| longitude | double precision | yes |  |  |  |
| population | bigint | no |  |  |  |
| area | integer | no |  |  |  |
| capital | text | yes |  |  |  |
| callingcodes | text[] | no |  |  |  |

## Outbound foreign keys
- subregion → meta_subregions.ID (fk_meta_countries_subregion)
- currency → meta_currencies.ID (fk_meta_countries_currency)
- tld → meta_tlds.ID (fk_meta_countries_tld)

## Inbound references
- meta_countries_borders.country → meta_countries.ID (fk_meta_countries_borders_language)
- meta_countries_borders.ID → meta_countries.ID (fk_meta_countries_borders_id)
- meta_countries_languages.ID → meta_countries.ID (fk_meta_countries_languages_id)
- meta_countries_names.ID → meta_countries.ID (fk_meta_countries_names_id)
- meta_postalcodes.country → meta_countries.ID (fk_meta_postalcodes_country)
- meta_states.country → meta_countries.ID (fk_meta_states_country)
- meta_timezones.country → meta_countries.ID (fk_meta_timezones_country)

---

# meta_countries_borders (table)

Country border relationships.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | smallint | yes |  |  | meta_countries.ID (fk_meta_countries_borders_id) |
| country | smallint | yes |  |  | meta_countries.ID (fk_meta_countries_borders_language) |

## Outbound foreign keys
- ID → meta_countries.ID (fk_meta_countries_borders_id)
- country → meta_countries.ID (fk_meta_countries_borders_language)

## Inbound references
- (none)

---

# meta_countries_languages (table)

Languages spoken per country.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | smallint | yes |  |  | meta_countries.ID (fk_meta_countries_languages_id) |
| language | smallint | yes |  |  | meta_languages.ID (fk_meta_countries_languages_language) |
| priority | smallint | yes |  |  |  |

## Outbound foreign keys
- ID → meta_countries.ID (fk_meta_countries_languages_id)
- language → meta_languages.ID (fk_meta_countries_languages_language)

## Inbound references
- (none)

---

# meta_countries_names (table)

Localized country names.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | smallint | yes |  |  | meta_countries.ID (fk_meta_countries_names_id) |
| language | smallint | yes |  |  | meta_languages.ID (fk_meta_countries_names_language) |
| name | text | yes |  |  |  |
| formal | text | yes |  |  |  |

## Outbound foreign keys
- ID → meta_countries.ID (fk_meta_countries_names_id)
- language → meta_languages.ID (fk_meta_countries_names_language)

## Inbound references
- (none)

---

# meta_currencies (table)

ISO currency codes with symbols and formatting.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | smallint | yes |  |  |  |
| iso_alpha | character varying(3) | yes |  |  |  |
| iso_numeric | character varying(3) | yes |  |  |  |
| fund | boolean | yes |  |  |  |
| decimals | smallint | no |  |  |  |
| symbol | text | yes |  |  |  |
| withdrawal | text | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- meta_countries.currency → meta_currencies.ID (fk_meta_countries_currency)
- meta_currencies_names.ID → meta_currencies.ID (fk_meta_currencies_names_id)

---

# meta_currencies_names (table)

Localized currency names.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | smallint | yes |  |  | meta_currencies.ID (fk_meta_currencies_names_id) |
| language | smallint | yes |  |  | meta_languages.ID (fk_meta_currencies_names_language) |
| name | text | yes |  |  |  |

## Outbound foreign keys
- ID → meta_currencies.ID (fk_meta_currencies_names_id)
- language → meta_languages.ID (fk_meta_currencies_names_language)

## Inbound references
- (none)

---

# meta_languages (table)

ISO language codes.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | smallint | yes |  |  |  |
| iso_alpha2 | character varying(2) | yes |  |  |  |
| iso_alpha3t | character varying(3) | yes |  |  |  |
| iso_alpha3b | character varying(3) | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- meta_countries_languages.language → meta_languages.ID (fk_meta_countries_languages_language)
- meta_countries_names.language → meta_languages.ID (fk_meta_countries_names_language)
- meta_currencies_names.language → meta_languages.ID (fk_meta_currencies_names_language)
- meta_languages_names.ID → meta_languages.ID (fk_meta_languages_names_id)
- meta_languages_names.language → meta_languages.ID (fk_meta_languages_names_language)
- meta_modules_names.language → meta_languages.ID (fk_meta_modules_names_language)
- meta_regions_names.language → meta_languages.ID (fk_meta_regions_names_language)
- meta_subregions_names.language → meta_languages.ID (fk_meta_subregions_names_language)
- meta_taxonomy_cn_names.language → meta_languages.ID (fk_meta_taxonomy_cn_names_language)
- meta_taxonomy_cpv_names.language → meta_languages.ID (fk_meta_taxonomy_cpv_names_language)
- meta_taxonomy_google_names.language → meta_languages.ID (fk_meta_taxonomy_google_names_language)
- meta_taxonomy_gpc_names.language → meta_languages.ID (fk_meta_taxonomy_gpc_names_language)
- meta_taxonomy_hts_names.language → meta_languages.ID (fk_meta_taxonomy_hts_names_language)
- meta_taxonomy_unspsc_names.language → meta_languages.ID (fk_meta_taxonomy_unspsc_names_language)

---

# meta_languages_names (table)

Localized language names.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | smallint | yes |  |  | meta_languages.ID (fk_meta_languages_names_id) |
| language | smallint | yes |  |  | meta_languages.ID (fk_meta_languages_names_language) |
| name | text | yes |  |  |  |

## Outbound foreign keys
- ID → meta_languages.ID (fk_meta_languages_names_id)
- language → meta_languages.ID (fk_meta_languages_names_language)

## Inbound references
- (none)

---

# meta_modules (table)

ZeyOS module definitions.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | smallint | yes |  |  |  |
| umi | text | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- meta_modules_names.ID → meta_modules.ID (fk_meta_modules_names_id)

---

# meta_modules_names (table)

Localized module names.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | smallint | yes |  |  | meta_modules.ID (fk_meta_modules_names_id) |
| language | smallint | yes |  |  | meta_languages.ID (fk_meta_modules_names_language) |
| name | text | yes |  |  |  |

## Outbound foreign keys
- ID → meta_modules.ID (fk_meta_modules_names_id)
- language → meta_languages.ID (fk_meta_modules_names_language)

## Inbound references
- (none)

---

# meta_postalcodes (table)

Postal code lookup data by country.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | integer | yes |  |  |  |
| country | smallint | yes |  |  | meta_countries.ID (fk_meta_postalcodes_country) |
| state | smallint | no |  |  | meta_states.ID (fk_meta_postalcodes_state) |
| code | character varying(20) | yes |  |  |  |
| place | text | yes |  |  |  |
| latitude | double precision | yes |  |  |  |
| longitude | double precision | yes |  |  |  |

## Outbound foreign keys
- country → meta_countries.ID (fk_meta_postalcodes_country)
- state → meta_states.ID (fk_meta_postalcodes_state)

## Inbound references
- (none)

---

# meta_regions (table)

World regions (continents/areas).

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | smallint | yes |  |  |  |
| wikidataid | text | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- meta_regions_names.ID → meta_regions.ID (fk_meta_regions_names_id)
- meta_subregions.region → meta_regions.ID (fk_meta_subregions_region)

---

# meta_regions_names (table)

Localized region names.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | smallint | yes |  |  | meta_regions.ID (fk_meta_regions_names_id) |
| language | smallint | yes |  |  | meta_languages.ID (fk_meta_regions_names_language) |
| name | text | yes |  |  |  |

## Outbound foreign keys
- ID → meta_regions.ID (fk_meta_regions_names_id)
- language → meta_languages.ID (fk_meta_regions_names_language)

## Inbound references
- (none)

---

# meta_states (table)

Country states/provinces.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | smallint | yes |  |  |  |
| country | smallint | yes |  |  | meta_countries.ID (fk_meta_states_country) |
| code | character varying(5) | yes |  |  |  |
| name | text | yes |  |  |  |
| latitude | double precision | yes |  |  |  |
| longitude | double precision | yes |  |  |  |

## Outbound foreign keys
- country → meta_countries.ID (fk_meta_states_country)

## Inbound references
- meta_cities.state → meta_states.ID (fk_meta_cities_state)
- meta_postalcodes.state → meta_states.ID (fk_meta_postalcodes_state)

---

# meta_subregions (table)

World subregions.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | smallint | yes |  |  |  |
| region | smallint | yes |  |  | meta_regions.ID (fk_meta_subregions_region) |
| wikidataid | text | yes |  |  |  |

## Outbound foreign keys
- region → meta_regions.ID (fk_meta_subregions_region)

## Inbound references
- meta_countries.subregion → meta_subregions.ID (fk_meta_countries_subregion)
- meta_subregions_names.ID → meta_subregions.ID (fk_meta_subregions_names_id)

---

# meta_subregions_names (table)

Localized subregion names.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | smallint | yes |  |  | meta_subregions.ID (fk_meta_subregions_names_id) |
| language | smallint | yes |  |  | meta_languages.ID (fk_meta_subregions_names_language) |
| name | text | yes |  |  |  |

## Outbound foreign keys
- ID → meta_subregions.ID (fk_meta_subregions_names_id)
- language → meta_languages.ID (fk_meta_subregions_names_language)

## Inbound references
- (none)

---

# meta_taxonomy_cn (table)

CN (Combined Nomenclature) product codes.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | smallint | yes |  |  |  |
| parents | smallint[] | no |  |  |  |
| code | character varying(8) | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- meta_taxonomy_cn_names.ID → meta_taxonomy_cn.ID (fk_meta_taxonomy_cn_names_id)

---

# meta_taxonomy_cn_names (table)

Localized CN code descriptions.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | smallint | yes |  |  | meta_taxonomy_cn.ID (fk_meta_taxonomy_cn_names_id) |
| language | smallint | yes |  |  | meta_languages.ID (fk_meta_taxonomy_cn_names_language) |
| name | text | yes |  |  |  |

## Outbound foreign keys
- ID → meta_taxonomy_cn.ID (fk_meta_taxonomy_cn_names_id)
- language → meta_languages.ID (fk_meta_taxonomy_cn_names_language)

## Inbound references
- (none)

---

# meta_taxonomy_cpv (table)

CPV (Common Procurement Vocabulary) codes.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | smallint | yes |  |  |  |
| parents | smallint[] | no |  |  |  |
| code | character varying(10) | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- meta_taxonomy_cpv_names.ID → meta_taxonomy_cpv.ID (fk_meta_taxonomy_cpv_names_id)

---

# meta_taxonomy_cpv_names (table)

Localized CPV code descriptions.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | smallint | yes |  |  | meta_taxonomy_cpv.ID (fk_meta_taxonomy_cpv_names_id) |
| language | smallint | yes |  |  | meta_languages.ID (fk_meta_taxonomy_cpv_names_language) |
| name | text | yes |  |  |  |

## Outbound foreign keys
- ID → meta_taxonomy_cpv.ID (fk_meta_taxonomy_cpv_names_id)
- language → meta_languages.ID (fk_meta_taxonomy_cpv_names_language)

## Inbound references
- (none)

---

# meta_taxonomy_google (table)

Google product taxonomy codes.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | smallint | yes |  |  |  |
| parents | smallint[] | no |  |  |  |
| code | integer | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- meta_taxonomy_google_names.ID → meta_taxonomy_google.ID (fk_meta_taxonomy_google_names_id)

---

# meta_taxonomy_google_names (table)

Localized Google taxonomy descriptions.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | smallint | yes |  |  | meta_taxonomy_google.ID (fk_meta_taxonomy_google_names_id) |
| language | smallint | yes |  |  | meta_languages.ID (fk_meta_taxonomy_google_names_language) |
| name | text | yes |  |  |  |

## Outbound foreign keys
- ID → meta_taxonomy_google.ID (fk_meta_taxonomy_google_names_id)
- language → meta_languages.ID (fk_meta_taxonomy_google_names_language)

## Inbound references
- (none)

---

# meta_taxonomy_gpc (table)

GPC (Global Product Classification) codes.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | smallint | yes |  |  |  |
| parents | smallint[] | no |  |  |  |
| code | character varying(17) | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- meta_taxonomy_gpc_names.ID → meta_taxonomy_gpc.ID (fk_meta_taxonomy_gpc_names_id)

---

# meta_taxonomy_gpc_names (table)

Localized GPC code descriptions.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | smallint | yes |  |  | meta_taxonomy_gpc.ID (fk_meta_taxonomy_gpc_names_id) |
| language | smallint | yes |  |  | meta_languages.ID (fk_meta_taxonomy_gpc_names_language) |
| name | text | yes |  |  |  |
| definition | text | yes |  |  |  |

## Outbound foreign keys
- ID → meta_taxonomy_gpc.ID (fk_meta_taxonomy_gpc_names_id)
- language → meta_languages.ID (fk_meta_taxonomy_gpc_names_language)

## Inbound references
- (none)

---

# meta_taxonomy_hts (table)

HTS (Harmonized Tariff Schedule) codes.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | integer | yes |  |  |  |
| parents | integer[] | no |  |  |  |
| code | character varying(10) | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- meta_taxonomy_hts_names.ID → meta_taxonomy_hts.ID (fk_meta_taxonomy_hts_names_id)

---

# meta_taxonomy_hts_names (table)

Localized HTS code descriptions.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | integer | yes |  |  | meta_taxonomy_hts.ID (fk_meta_taxonomy_hts_names_id) |
| language | integer | yes |  |  | meta_languages.ID (fk_meta_taxonomy_hts_names_language) |
| name | text | yes |  |  |  |

## Outbound foreign keys
- ID → meta_taxonomy_hts.ID (fk_meta_taxonomy_hts_names_id)
- language → meta_languages.ID (fk_meta_taxonomy_hts_names_language)

## Inbound references
- (none)

---

# meta_taxonomy_unspsc (table)

UNSPSC product classification codes.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | smallint | yes |  |  |  |
| parents | smallint[] | no |  |  |  |
| code | character varying(8) | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- meta_taxonomy_unspsc_names.ID → meta_taxonomy_unspsc.ID (fk_meta_taxonomy_unspsc_names_id)

---

# meta_taxonomy_unspsc_names (table)

Localized UNSPSC code descriptions.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | smallint | yes |  |  | meta_taxonomy_unspsc.ID (fk_meta_taxonomy_unspsc_names_id) |
| language | smallint | yes |  |  | meta_languages.ID (fk_meta_taxonomy_unspsc_names_language) |
| name | text | yes |  |  |  |

## Outbound foreign keys
- ID → meta_taxonomy_unspsc.ID (fk_meta_taxonomy_unspsc_names_id)
- language → meta_languages.ID (fk_meta_taxonomy_unspsc_names_language)

## Inbound references
- (none)

---

# meta_timezones (table)

Timezone definitions.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | smallint | yes |  |  |  |
| country | smallint | no |  |  | meta_countries.ID (fk_meta_timezones_country) |
| name | text | yes |  |  |  |
| latitude | double precision | no |  |  |  |
| longitude | double precision | no |  |  |  |
| comments | text | yes |  |  |  |
| abbreviations | text[] | no |  |  |  |

## Outbound foreign keys
- country → meta_countries.ID (fk_meta_timezones_country)

## Inbound references
- (none)

---

# meta_timezones_offsets (view)

Timezone UTC offsets including DST.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | smallint | no |  |  |  |
| country | smallint | no |  |  |  |
| name | text | no |  |  |  |
| latitude | double precision | no |  |  |  |
| longitude | double precision | no |  |  |  |
| comments | text | no |  |  |  |
| abbreviations | text[] | no |  |  |  |
| offset | interval | no |  |  |  |
| dst | boolean | no |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# meta_tlds (table)

Top-level domain (TLD) codes.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | smallint | yes |  |  |  |
| domain | text | yes |  |  |  |
| suffixes | text[] | no |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- meta_countries.tld → meta_tlds.ID (fk_meta_countries_tld)

---

# meta_units (table)

Unit of measure codes (UN/CEFACT).

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | smallint | yes |  |  |  |
| status | smallint | yes |  |  |  |
| code | character varying(3) | yes |  |  |  |
| level | character varying(3) | yes |  |  |  |
| name | text | yes |  |  |  |
| sector | text | yes |  |  |  |
| quantity | text | yes |  |  |  |
| conversion | text | yes |  |  |  |
| symbol | text | yes |  |  |  |
| description | text | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# notes (table)

Rich text notes with file attachments.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | integer | yes |  | Note ID |  |
| fork | integer | no |  | Fork ID (`null` for base module) | forks.ID (fk_notes_fork) |
| owneruser | integer | no |  | Owner user ID (PUBLIC if `owneruser`=`null` and `ownergroup`=`null`) | users.ID (fk_notes_owneruser) |
| ownergroup | integer | no |  | Owner group ID (PUBLIC if `owneruser`=`null` and `ownergroup`=`null`) | groups.ID (fk_notes_ownergroup) |
| creator | integer | no |  | Creator user ID (defaults to authenticated user on creation) |  |
| assigneduser | integer | no |  | Assigned user ID | users.ID (fk_notes_assigneduser) |
| creationdate | bigint | yes | date_part('epoch', now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | date_part('epoch', now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| binfile | integer | no |  | Binary file ID; is read-only (not for `PUT` or `PATCH`) | binfiles.ID (fk_notes_binfile) |
| visibility | smallint | yes | 0 | Visibility (`0`=REGULAR, `1`=ARCHIVED, `2`=DELETED) |  |
| name | text | yes |  | Name |  |
| status | smallint | yes | 0 | Status (`0`=DRAFT, `1`=FEEDBACKREQUIRED, `2`=INREVISION, `3`=AWAITINGAPPROVAL, `4`=FINAL, `5`=OBSOLETE) |  |
| contenttype | text | yes | '' | Content [MIME type](https://en.wikipedia.org/wiki/Media_type) ([RFC 2045](https://tools.ietf.org/html/rfc2045)) |  |
| text | text | yes | '' | Plain text version of content |  |
| attachments | text[] | no |  | [Array](https://www.postgresql.org/docs/current/arrays.html)-encoded attachments (filenames) |  |
| description | text | yes | '' | Detailed general description |  |

## Outbound foreign keys
- fork → forks.ID (fk_notes_fork)
- owneruser → users.ID (fk_notes_owneruser)
- ownergroup → groups.ID (fk_notes_ownergroup)
- assigneduser → users.ID (fk_notes_assigneduser)
- binfile → binfiles.ID (fk_notes_binfile)

## Inbound references
- (none)

---

# notifications (table)

User notification flags for activity records.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| user | integer | yes |  |  |  |
| record | bigint | yes |  |  |  |
| date | bigint | yes |  |  |  |
| flag | smallint | yes | 0 |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# numcounters (table)

Auto-incrementing number counters for document numbering.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| identifier | text | yes |  |  |  |
| counter | bigint | yes | 0 |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# objects (table)

Generic JSON data objects with entity typing.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | integer | yes |  | Object ID |  |
| fork | integer | no |  | Fork ID (`null` for base module) | forks.ID (fk_objects_fork) |
| owneruser | integer | no |  | Owner user ID (PUBLIC if `owneruser`=`null` and `ownergroup`=`null`) | users.ID (fk_objects_owneruser) |
| ownergroup | integer | no |  | Owner group ID (PUBLIC if `owneruser`=`null` and `ownergroup`=`null`) | groups.ID (fk_objects_ownergroup) |
| creator | integer | no |  | Creator user ID (defaults to authenticated user on creation) |  |
| assigneduser | integer | no |  | Assigned user ID | users.ID (fk_objects_assigneduser) |
| creationdate | bigint | yes | date_part('epoch', now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | date_part('epoch', now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| binfile | integer | no |  | Binary file ID; is read-only (not for `PUT` or `PATCH`) | binfiles.ID (fk_objects_binfile) |
| visibility | smallint | yes | 0 | Visibility (`0`=REGULAR, `1`=ARCHIVED, `2`=DELETED) |  |
| name | text | yes |  | Name |  |
| entity | text | yes |  | Custom entity |  |
| date | bigint | yes | EXTRACT(epoch FROM now()) | Designated date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| description | text | yes | '' | Detailed general description |  |
| data | json | no |  | [JSON](https://tools.ietf.org/html/rfc7159)-encoded object data (array or object) |  |

## Outbound foreign keys
- fork → forks.ID (fk_objects_fork)
- owneruser → users.ID (fk_objects_owneruser)
- ownergroup → groups.ID (fk_objects_ownergroup)
- assigneduser → users.ID (fk_objects_assigneduser)
- binfile → binfiles.ID (fk_objects_binfile)

## Inbound references
- (none)

---

# opportunities (table)

Sales opportunities with probability and revenue forecasting.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | integer | yes |  | Opportunity ID |  |
| fork | integer | no |  | Fork ID (`null` for base module) | forks.ID (fk_opportunities_fork) |
| ownergroup | integer | no |  | Owner group ID (`null`=PUBLIC) | groups.ID (fk_opportunities_ownergroup) |
| creator | integer | no |  | Creator user ID (defaults to authenticated user on creation) |  |
| assigneduser | integer | no |  | Assigned user ID | users.ID (fk_opportunities_assigneduser) |
| creationdate | bigint | yes | date_part('epoch', now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | date_part('epoch', now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| account | integer | no |  | Account ID | accounts.ID (fk_opportunities_account) |
| contact | integer | no |  | Contact ID | contacts.ID (fk_opportunities_contact) |
| campaign | integer | no |  | Campaign ID | campaigns.ID (fk_opportunities_campaign) |
| visibility | smallint | yes | 0 | Visibility (`0`=REGULAR, `1`=ARCHIVED, `2`=DELETED) |  |
| name | text | yes |  | Name |  |
| opportunitynum | text | yes | '' | Opportunity number |  |
| date | bigint | yes | EXTRACT(epoch FROM now()) | Designated date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| duedate | bigint | no |  | Due date as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) |  |
| status | smallint | yes | 0 | Status (`0`=UNEVALUATED, `1`=ELIGIBLE, `2`=FEEDBACKREQUIRED, `3`=INNEGOTIATION, `4`=OFFERED, `5`=ACCEPTED, `6`=REJECTED) |  |
| priority | smallint | yes | 2 | Priority (`0`=LOWEST, `1`=LOW, `2`=MEDIUM, `3`=HIGH, `4`=HIGHEST) |  |
| probability | smallint | yes | 0 | Probability of success in percent; must be `100` for ACCEPTED |  |
| worstcase | double precision | yes | 0 | Worst-case monetary outcome |  |
| mostlikely | double precision | yes | 0 | Most likely monetary outcome |  |
| upside | double precision | yes | 0 | Upside monetary outcome |  |
| description | text | yes | '' | Detailed general description |  |

## Outbound foreign keys
- fork → forks.ID (fk_opportunities_fork)
- ownergroup → groups.ID (fk_opportunities_ownergroup)
- assigneduser → users.ID (fk_opportunities_assigneduser)
- account → accounts.ID (fk_opportunities_account)
- contact → contacts.ID (fk_opportunities_contact)
- campaign → campaigns.ID (fk_opportunities_campaign)

## Inbound references
- messages.opportunity → opportunities.ID (fk_messages_opportunity)

---

# participants (table)

Campaign and mailing list participants with contact info.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | bigint | yes |  | Particpants ID |  |
| creator | integer | no |  | Creator user ID (defaults to authenticated user on creation) |  |
| creationdate | bigint | yes | date_part('epoch', now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | date_part('epoch', now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| mailinglist | integer | no |  | Mailing list ID (**dependency**); is mutually exclusive to `campaign` (either one is required) | mailinglists.ID (fk_participants_mailinglist) |
| campaign | integer | no |  | Campaign ID (**dependency**); is mutually exclusive to `mailinglist` (either one is required) | campaigns.ID (fk_participants_campaign) |
| contact | integer | no |  | Contact ID | contacts.ID (fk_participants_contact) |
| name | text | yes |  | Name |  |
| phone | text | yes | '' | Phone number |  |
| email | text | yes | '' | E-mail address |  |

## Outbound foreign keys
- mailinglist → mailinglists.ID (fk_participants_mailinglist)
- campaign → campaigns.ID (fk_participants_campaign)
- contact → contacts.ID (fk_participants_contact)

## Inbound references
- mailingrecipients.participant → participants.ID (fk_mailingrecipients_participant)

---

# payments (table)

Payment records linked to ledgers and transactions.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | integer | yes |  | Payment ID |  |
| fork | integer | no |  | Fork ID (`null` for base module) | forks.ID (fk_payments_fork) |
| ownergroup | integer | no |  | Owner group ID (`null`=PUBLIC) | groups.ID (fk_payments_ownergroup) |
| creator | integer | no |  | Creator user ID (defaults to authenticated user on creation) |  |
| assigneduser | integer | no |  | Assigned user ID | users.ID (fk_payments_assigneduser) |
| creationdate | bigint | yes | date_part('epoch', now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | date_part('epoch', now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| ledger | integer | no |  | Ledger ID | ledgers.ID (fk_payments_ledger) |
| transaction | integer | no |  | Transaction ID; is mutually exclusive to `account` | transactions.ID (fk_payments_transaction) |
| account | integer | no |  | Account ID; is mutually exclusive to `transaction` | accounts.ID (fk_payments_account) |
| date | bigint | yes | date_part('epoch', now()) | Designated date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| subject | text | yes | '' | Subject (e.g. bank statement or reference number) |  |
| status | smallint | yes | 0 | Status (`0`=DRAFT, `1`=COMPLETED, `2`=CANCELLED, `3`=BOOKED) |  |
| amount | double precision | yes |  | Amount (monetary) |  |
| autoadvance | smallint | yes | 0 | Auto-advance to next transaction |  |
| description | text | yes | '' | Detailed general description |  |

## Outbound foreign keys
- fork → forks.ID (fk_payments_fork)
- ownergroup → groups.ID (fk_payments_ownergroup)
- assigneduser → users.ID (fk_payments_assigneduser)
- ledger → ledgers.ID (fk_payments_ledger)
- transaction → transactions.ID (fk_payments_transaction)
- account → accounts.ID (fk_payments_account)

## Inbound references
- (none)

---

# permissions (table)

Group-based access permissions for views and features.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | bigint | yes |  | Permission ID |  |
| creator | integer | no |  | Creator user ID (defaults to authenticated user on creation) |  |
| creationdate | bigint | yes | date_part('epoch', now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | date_part('epoch', now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| group | integer | yes |  | Group ID (**dependency**) | groups.ID (fk_permissions_group) |
| fork | integer | no |  | Fork ID; is mutually exclusive to `application` and `identifier` (either one is required) | forks.ID (fk_permissions_fork) |
| application | integer | no |  | Application ID; is mutually exclusive to `fork` and `identifier` (either one is required) | applications.ID (fk_permissions_application) |
| identifier | character varying(200) | no |  | Permission identifier (e.g. module); is mutually exclusive to `fork` and `application` (either one is required) |  |
| writable | smallint | yes | 0 | Allow writing of permission-specific data by group members |  |

## Outbound foreign keys
- group → groups.ID (fk_permissions_group)
- fork → forks.ID (fk_permissions_fork)
- application → applications.ID (fk_permissions_application)

## Inbound references
- (none)

---

# pricelists (table)

Price lists with date validity and account assignments.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | integer | yes |  | Price list ID |  |
| fork | integer | no |  | Fork ID (`null` for base module) | forks.ID (fk_pricelists_fork) |
| ownergroup | integer | no |  | Owner group ID (`null`=PUBLIC) | groups.ID (fk_pricelists_ownergroup) |
| creator | integer | no |  | Creator user ID (defaults to authenticated user on creation) |  |
| creationdate | bigint | yes | date_part('epoch', now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | date_part('epoch', now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| activity | smallint | yes | 0 | Activity (`0`=ACTIVE, `1`=DEACTIVATED, `2`=DELETED) |  |
| name | text | yes |  | Name |  |
| type | smallint | yes | 0 | Price list type (`0`=BILLING_MIN, `1`=BILLING_MAX, `2`=PROCUREMENT_MIN, `3`=PROCUREMENT_MAX, `4`=PRODUCTION_MIN, `5`=PRODUCTION_MAX) |  |
| currency | character varying(3) | yes |  | Currency code ([ISO 4217](https://en.wikipedia.org/wiki/ISO_4217)) |  |
| discount | double precision | yes | 0 | Default relative discount in percent |  |
| datefrom | bigint | no |  | Start date as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time); must be less than or equal to `dateto` |  |
| dateto | bigint | no |  | End date as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time); must be greater than or equal to `datefrom` |  |
| applytoall | smallint | yes | 0 | Apply to all accounts regardless of association via `pricelists2accounts` |  |
| description | text | yes | '' | Detailed general description |  |

## Outbound foreign keys
- fork → forks.ID (fk_pricelists_fork)
- ownergroup → groups.ID (fk_pricelists_ownergroup)

## Inbound references
- pricelists2accounts.pricelist → pricelists.ID (fk_pricelists2accounts_pricelist)
- prices.pricelist → pricelists.ID (fk_prices_pricelist)

---

# pricelists2accounts (table)

Junction table linking price lists to accounts.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | bigint | yes |  | Pricelist-to-account ID |  |
| creator | integer | no |  | Creator user ID (defaults to authenticated user on creation) |  |
| creationdate | bigint | yes | date_part('epoch', now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | EXTRACT(epoch FROM now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| pricelist | integer | yes |  | Price list ID (**dependency**) | pricelists.ID (fk_pricelists2accounts_pricelist) |
| account | integer | yes |  | Account ID (**dependency**) | accounts.ID (fk_pricelists2accounts_account) |

## Outbound foreign keys
- pricelist → pricelists.ID (fk_pricelists2accounts_pricelist)
- account → accounts.ID (fk_pricelists2accounts_account)

## Inbound references
- (none)

---

# prices (table)

Item prices per price list with rebates and discounts.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | bigint | yes |  | Price ID |  |
| creator | integer | no |  | Creator user ID (defaults to authenticated user on creation) |  |
| creationdate | bigint | yes | date_part('epoch', now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | date_part('epoch', now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| item | integer | yes |  | Item ID (**dependency**) | items.ID (fk_prices_item) |
| pricelist | integer | yes |  | Price list ID (**dependency**) | pricelists.ID (fk_prices_pricelist) |
| price | double precision | no |  | Price per unit (`null`=`item.sellingprice` for billing or `null`=`item.purchaseprice` for procurement) |  |
| rebate | double precision | yes | 0 | Absolute rebate per unit (applied before `discount`) |  |
| discount | double precision | no |  | Relative discount in percent (applied after `rebate`; `null`=`pricelist.discount`) |  |
| minamount | double precision | yes | 0 | Minimum amount (quantity) |  |
| costprice | double precision | no |  | Cost price per unit (`null`=`item.purchaseprice` for billing) |  |

## Outbound foreign keys
- item → items.ID (fk_prices_item)
- pricelist → pricelists.ID (fk_prices_pricelist)

## Inbound references
- (none)

---

# projects (table)

Project records for organizing tasks and tickets.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | integer | yes |  | Project ID |  |
| fork | integer | no |  | Fork ID (`null` for base module) | forks.ID (fk_projects_fork) |
| owneruser | integer | no |  | Owner user ID (PUBLIC if `owneruser`=`null` and `ownergroup`=`null`) | users.ID (fk_projects_owneruser) |
| ownergroup | integer | no |  | Owner group ID (PUBLIC if `owneruser`=`null` and `ownergroup`=`null`) | groups.ID (fk_projects_ownergroup) |
| creator | integer | no |  | Creator user ID (defaults to authenticated user on creation) |  |
| assigneduser | integer | no |  | Assigned user ID | users.ID (fk_projects_assigneduser) |
| creationdate | bigint | yes | date_part('epoch', now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | date_part('epoch', now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| account | integer | no |  | Account ID | accounts.ID (fk_projects_account) |
| visibility | smallint | yes | 0 | Visibility (`0`=REGULAR, `1`=ARCHIVED, `2`=DELETED) |  |
| name | text | yes |  | Name |  |
| projectnum | text | yes | '' | Project number |  |
| status | smallint | yes | 0 | Status (`0`=DRAFT, `1`=NOTSTARTED, `2`=AWAITINGAPPROVAL, `3`=APPROVED, `4`=DISMISSED, `5`=ACTIVE, `6`=INACTIVE, `7`=TESTING, `8`=CANCELLED, `9`=COMPLETED, `10`=FAILED, `11`=BOOKED) |  |
| description | text | yes | '' | Detailed general description |  |

## Outbound foreign keys
- fork → forks.ID (fk_projects_fork)
- owneruser → users.ID (fk_projects_owneruser)
- ownergroup → groups.ID (fk_projects_ownergroup)
- assigneduser → users.ID (fk_projects_assigneduser)
- account → accounts.ID (fk_projects_account)

## Inbound references
- tasks.project → projects.ID (fk_tasks_project)
- tickets.project → projects.ID (fk_tickets_project)

---

# recent (table)

Recently accessed entities per user.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| entity | t_entity | yes |  |  |  |
| index | integer | yes |  |  |  |
| user | integer | yes |  |  |  |
| date | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# records (table)

Activity feed records with comments, files, and monitor entries.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | bigint | yes |  | Record ID |  |
| fork | integer | no |  | Fork ID (`null` for base module); inherited from entity | forks.ID (fk_records_fork) |
| owneruser | integer | no |  | Owner user ID (PUBLIC if `owneruser`=`null` and `ownergroup`=`null`) | users.ID (fk_records_owneruser) |
| ownergroup | integer | no |  | Owner group ID (PUBLIC if `owneruser`=`null` and `ownergroup`=`null`) | groups.ID (fk_records_ownergroup) |
| creator | integer | no |  | Creator user ID (defaults to authenticated user on creation) |  |
| assigneduser | integer | no |  | Assigned user (recipient) ID; must be distinct from `creator` | users.ID (fk_records_assigneduser) |
| creationdate | bigint | yes | date_part('epoch', now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | date_part('epoch', now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| entity | t_entity | no |  | Canonical entity |  |
| index | integer | no |  | Entity ID; is required if `entity` is not `null`, otherwise must be `null` |  |
| channel | integer | no |  | Channel ID | channels.ID (fk_records_channel) |
| flag | smallint | yes | 0 | Flag (`0`=REGULAR, `1`=ASSOCONLY, `2`=MINDLOGONLY, `3`=MONITOR, `4`=FEED); must be REGULAR or FEED if `entity` is `null` |  |
| date | bigint | yes | date_part('epoch', now()) | Designated date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| stickydate | bigint | no |  | Sticky date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) |  |
| sender | text | yes | '' | Sender |  |
| location | text | yes | '' | Location (e.g. coordinates) |  |
| text | text | yes | '' | Record text ([Markdown](https://en.wikipedia.org/wiki/Markdown) for rich text representation) |  |
| meta | json | no |  | [JSON](https://tools.ietf.org/html/rfc7159)-encoded metadata (object) |  |

## Outbound foreign keys
- fork → forks.ID (fk_records_fork)
- owneruser → users.ID (fk_records_owneruser)
- ownergroup → groups.ID (fk_records_ownergroup)
- assigneduser → users.ID (fk_records_assigneduser)
- channel → channels.ID (fk_records_channel)

## Inbound references
- comments.record → records.ID (fk_comments_record)
- feedids.record → records.ID (fk_feedids_record)
- files.record → records.ID (fk_files_record)
- likes.record → records.ID (fk_likes_record)

---

# relateditems (table)

Related item associations for cross-selling.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | bigint | yes |  | Component ID |  |
| creator | integer | no |  | Creator user ID (defaults to authenticated user on creation) |  |
| creationdate | bigint | yes | EXTRACT(epoch FROM now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | EXTRACT(epoch FROM now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| item | integer | yes |  | Item ID (**dependency**) | items.ID (fk_relateditems_item) |
| relateditem | integer | yes |  | Related item ID; must be distinct from `item` | items.ID (fk_relateditems_relateditem) |
| relation | text | yes | '' | Relation |  |

## Outbound foreign keys
- item → items.ID (fk_relateditems_item)
- relateditem → items.ID (fk_relateditems_relateditem)

## Inbound references
- (none)

---

# resources (table)

Reusable script resources for applications.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | integer | yes |  | Resource ID |  |
| creator | integer | no |  | Creator user ID (defaults to authenticated user on creation) |  |
| creationdate | bigint | yes | date_part('epoch', now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | date_part('epoch', now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| application | integer | no |  | Application ID (`null`=STANDALONE) | applications.ID (fk_resources_application) |
| activity | smallint | yes | 0 | Activity (`0`=ACTIVE, `1`=DEACTIVATED, `2`=DELETED) |  |
| name | text | yes |  | Name |  |
| identifier | character varying(200) | yes |  | Unique resource identifier |  |
| mimetype | text | yes | 'text/x-zymba' | [MIME type](https://en.wikipedia.org/wiki/Media_type) ([RFC 2045](https://tools.ietf.org/html/rfc2045)) |  |
| public | smallint | yes | 0 | Publicly accessible |  |
| binfile | integer | no |  |  | binfiles.ID (fk_resources_binfile) |

## Outbound foreign keys
- application → applications.ID (fk_resources_application)
- binfile → binfiles.ID (fk_resources_binfile)

## Inbound references
- (none)

---

# services (table)

Background services and scheduled jobs.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | integer | yes |  | Service ID |  |
| creator | integer | no |  | Creator user ID (defaults to authenticated user on creation) |  |
| creationdate | bigint | yes | date_part('epoch', now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | date_part('epoch', now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| application | integer | no |  | Application ID (`null`=STANDALONE) | applications.ID (fk_services_application) |
| activity | smallint | yes | 0 | Activity (`0`=ACTIVE, `1`=DEACTIVATED, `2`=DELETED) |  |
| name | text | yes |  | Name |  |
| identifier | character varying(200) | yes |  | Unique service identifier |  |
| type | smallint | no |  | Service type (`0`=TIMING, `1`=REMOTECALL, `2`=AFTER_CREATION, `3`=BEFORE_MODIFICATION, `4`=AFTER_MODIFICATION, `5`=AFTER_CREATION_MODIFICATION, `6`=BEFORE_DELETION, `7`=AFTER_DELETION) |  |
| entity | text | yes | '' | Canonical entity; only for AFTER_CREATION, BEFORE_MODIFICATION, AFTER_MODIFICATION, AFTER_CREATION_MODIFICATION, BEFORE_DELETION or AFTER_DELETION |  |
| schedule | integer | yes | 0 | Schedule as a minute of each day; only for TIMING |  |
| interval | smallint | yes | 1 | Interval in minutes; only for TIMING |  |
| mimetype | text | yes | 'text/x-zymba' | [MIME type](https://en.wikipedia.org/wiki/Media_type) ([RFC 2045](https://tools.ietf.org/html/rfc2045)) |  |
| binfile | integer | no |  |  | binfiles.ID (fk_services_binfile) |
| url | text | yes | '' |  |  |
| accesskey | bytea | no |  |  |  |

## Outbound foreign keys
- application → applications.ID (fk_services_application)
- binfile → binfiles.ID (fk_services_binfile)

## Inbound references
- (none)

---

# stocktransactions (table)

Inventory stock movements with serial and charge tracking.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | bigint | yes |  | Stock transaction ID |  |
| creator | integer | no |  | Creator user ID (defaults to authenticated user on creation) |  |
| creationdate | bigint | yes | date_part('epoch', now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | date_part('epoch', now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| item | integer | yes |  | Item ID (**dependency**) | items.ID (fk_stocktransactions_item) |
| storage | integer | no |  | Storage ID | storages.ID (fk_stocktransactions_storage) |
| transaction | integer | no |  | Transaction ID | transactions.ID (fk_stocktransactions_transaction) |
| transfer | bigint | no |  | Transfer stock transaction ID; must be distinct from `ID` and `null` for RESERVED | stocktransactions.ID (fk_stocktransactions_transfer) |
| flag | smallint | yes | 0 | Flag (`0`=BOOKED, `1`=RESERVED, `2`=CANCELLED) |  |
| date | bigint | yes | date_part('epoch', now()) | Designated date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| chargenum | text | yes | '' | Charge (lot) number |  |
| location | text | yes | '' | Physical location (e.g. shelf identification) |  |
| reference | text | yes | '' | Reference identification |  |
| amount | double precision | yes |  | Amount (quantity); must not be zero (greater than zero if `transfer` is not `null`) |  |
| sellingprice | double precision | yes | 0 | Selling price per unit |  |
| purchaseprice | double precision | yes | 0 | Purchase price per unit |  |
| serials | text[] | no |  | [Array](https://www.postgresql.org/docs/current/arrays.html)-encoded serial numbers |  |
| subtransactions | bigint[] | no |  | [Array](https://www.postgresql.org/docs/current/arrays.html)-encoded sub-transaction IDs |  |

## Outbound foreign keys
- item → items.ID (fk_stocktransactions_item)
- storage → storages.ID (fk_stocktransactions_storage)
- transaction → transactions.ID (fk_stocktransactions_transaction)
- transfer → stocktransactions.ID (fk_stocktransactions_transfer)

## Inbound references
- stocktransactions.transfer → stocktransactions.ID (fk_stocktransactions_transfer)

---

# storages (table)

Warehouse and storage location definitions.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | integer | yes |  | Storage ID |  |
| fork | integer | no |  | Fork ID (`null` for base module) | forks.ID (fk_storages_fork) |
| ownergroup | integer | no |  | Owner group ID (`null`=PUBLIC) | groups.ID (fk_storages_ownergroup) |
| creator | integer | no |  | Creator user ID (defaults to authenticated user on creation) |  |
| creationdate | bigint | yes | date_part('epoch', now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | date_part('epoch', now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| visibility | smallint | yes | 0 | Visibility (`0`=REGULAR, `1`=ARCHIVED, `2`=DELETED) |  |
| name | text | yes |  | Name |  |
| description | text | yes | '' | Detailed general description |  |

## Outbound foreign keys
- fork → forks.ID (fk_storages_fork)
- ownergroup → groups.ID (fk_storages_ownergroup)

## Inbound references
- stocktransactions.storage → storages.ID (fk_stocktransactions_storage)

---

# suppliers (table)

Supplier associations for items with pricing and lead times.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | bigint | yes |  | Supplier ID |  |
| creator | integer | no |  | Creator user ID (defaults to authenticated user on creation) |  |
| creationdate | bigint | yes | date_part('epoch', now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | date_part('epoch', now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| item | integer | yes |  | Item ID (**dependency**) | items.ID (fk_suppliers_item) |
| account | integer | yes |  | Account ID (**dependency**) | accounts.ID (fk_suppliers_account) |
| itemnum | text | yes | '' | Supplier item number (SKU) |  |
| price | double precision | no |  | Supplier price per unit |  |
| taxrate | double precision | no |  | Supplier tax rate in percent |  |
| minamount | double precision | yes | 0 | Minimum order amount (quantity) |  |
| deliverytime | smallint | no |  | Expected delivery time in days |  |
| stock | double precision | no |  | Expected stock/inventory amount (quantity) |  |

## Outbound foreign keys
- item → items.ID (fk_suppliers_item)
- account → accounts.ID (fk_suppliers_account)

## Inbound references
- (none)

---

# tagnames (table)

Tag name definitions per entity type.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | bigint | yes |  |  |  |
| entity | t_entity | yes |  |  |  |
| name | text | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# tagrels (view)

Tag relationships linking tag names to entity indices.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| entity | t_entity | no |  |  |  |
| name | bigint | no |  |  |  |
| index | bigint | no |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# tagrels_accounts (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| name | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# tagrels_actionsteps (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| name | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# tagrels_applications (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| name | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# tagrels_appointments (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| name | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# tagrels_campaigns (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| name | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# tagrels_channels (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| name | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# tagrels_contacts (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| name | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# tagrels_contracts (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| name | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# tagrels_coupons (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| name | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# tagrels_customfields (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| name | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# tagrels_davservers (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| name | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# tagrels_devices (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| name | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# tagrels_documents (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| name | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# tagrels_dunning (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| name | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# tagrels_feedservers (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| name | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# tagrels_forks (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| name | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# tagrels_groups (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| name | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# tagrels_items (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| name | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# tagrels_ledgers (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| name | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# tagrels_links (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| name | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# tagrels_mailinglists (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| name | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# tagrels_mailservers (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| name | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# tagrels_messages (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| name | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# tagrels_notes (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| name | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# tagrels_objects (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| name | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# tagrels_opportunities (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| name | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# tagrels_payments (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| name | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# tagrels_pricelists (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| name | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# tagrels_projects (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| name | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# tagrels_resources (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| name | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# tagrels_services (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| name | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# tagrels_storages (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| name | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# tagrels_tasks (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| name | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# tagrels_tickets (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| name | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# tagrels_transactions (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| name | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# tagrels_users (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| name | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# tagrels_weblets (table)



## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| name | bigint | yes |  |  |  |
| index | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# tags (view)

View joining tag names with their entity associations.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| entity | t_entity | no |  |  |  |
| name | text | no |  |  |  |
| index | bigint | no |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# tasks (table)

Task records with priority, effort, and project linking.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | integer | yes |  | Task ID |  |
| fork | integer | no |  | Fork ID (`null` for base module) | forks.ID (fk_tasks_fork) |
| owneruser | integer | no |  | Owner user ID (PUBLIC if `owneruser`=`null` and `ownergroup`=`null`) | users.ID (fk_tasks_owneruser) |
| ownergroup | integer | no |  | Owner group ID (PUBLIC if `owneruser`=`null` and `ownergroup`=`null`) | groups.ID (fk_tasks_ownergroup) |
| creator | integer | no |  | Creator user ID (defaults to authenticated user on creation) |  |
| assigneduser | integer | no |  | Assigned user ID | users.ID (fk_tasks_assigneduser) |
| creationdate | bigint | yes | date_part('epoch', now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | date_part('epoch', now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| davserver | integer | no |  | DAV server ID | davservers.ID (fk_tasks_davserver) |
| ticket | integer | no |  | Ticket ID; is mutually exclusive to `project` | tickets.ID (fk_tasks_ticket) |
| project | integer | no |  | Project ID; is mutually exclusive to `ticket` | projects.ID (fk_tasks_project) |
| visibility | smallint | yes | 0 | Visibility (`0`=REGULAR, `1`=ARCHIVED, `2`=DELETED) |  |
| name | text | yes |  | Name |  |
| tasknum | text | yes | '' | Task number |  |
| datefrom | bigint | no |  | Start date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) |  |
| duedate | bigint | no |  | Due date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) |  |
| status | smallint | yes | 0 | Status (`0`=NOTSTARTED, `1`=AWAITINGACCEPTANCE, `2`=ACCEPTED, `3`=REJECTED, `4`=ACTIVE, `5`=INACTIVE, `6`=FEEDBACKREQUIRED, `7`=TESTING, `8`=CANCELLED, `9`=COMPLETED, `10`=FAILED, `11`=BOOKED) |  |
| priority | smallint | yes | 2 | Priority (`0`=LOWEST, `1`=LOW, `2`=MEDIUM, `3`=HIGH, `4`=HIGHEST) |  |
| projectedeffort | integer | yes | 0 | Projected effort in minutes |  |
| description | text | yes | '' | Detailed general description |  |

## Outbound foreign keys
- fork → forks.ID (fk_tasks_fork)
- owneruser → users.ID (fk_tasks_owneruser)
- ownergroup → groups.ID (fk_tasks_ownergroup)
- assigneduser → users.ID (fk_tasks_assigneduser)
- davserver → davservers.ID (fk_tasks_davserver)
- ticket → tickets.ID (fk_tasks_ticket)
- project → projects.ID (fk_tasks_project)

## Inbound references
- actionsteps.task → tasks.ID (fk_actionsteps_task)
- davids.task → tasks.ID (fk_davids_task)

---

# tickets (table)

Support tickets with status, priority, and billing items.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | integer | yes |  | Ticket ID |  |
| fork | integer | no |  | Fork ID (`null` for base module) | forks.ID (fk_tickets_fork) |
| ownergroup | integer | no |  | Owner group ID (`null`=PUBLIC) | groups.ID (fk_tickets_ownergroup) |
| creator | integer | no |  | Creator user ID (defaults to authenticated user on creation) |  |
| assigneduser | integer | no |  | Assigned user ID | users.ID (fk_tickets_assigneduser) |
| creationdate | bigint | yes | date_part('epoch', now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | date_part('epoch', now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| account | integer | no |  | Account ID; is mutually exclusive to `project` | accounts.ID (fk_tickets_account) |
| project | integer | no |  | Project ID; is mutually exclusive to `account` | projects.ID (fk_tickets_project) |
| visibility | smallint | yes | 0 | Visibility (`0`=REGULAR, `1`=ARCHIVED, `2`=DELETED) |  |
| name | text | yes |  | Name |  |
| ticketnum | text | yes | '' | Ticket number |  |
| date | bigint | yes | date_part('epoch', now()) | Designated date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| duedate | bigint | no |  | Due date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) |  |
| status | smallint | yes | 0 | Status (`0`=NOTSTARTED, `1`=AWAITINGACCEPTANCE, `2`=ACCEPTED, `3`=REJECTED, `4`=ACTIVE, `5`=INACTIVE, `6`=FEEDBACKREQUIRED, `7`=TESTING, `8`=CANCELLED, `9`=COMPLETED, `10`=FAILED, `11`=BOOKED) |  |
| priority | smallint | yes | 2 | Priority (`0`=LOWEST, `1`=LOW, `2`=MEDIUM, `3`=HIGH, `4`=HIGHEST) |  |
| description | text | yes | '' | Detailed general description |  |
| billingitems | json | no |  | [JSON](https://tools.ietf.org/html/rfc7159)-encoded items (array) |  |
| procurementitems | json | no |  | [JSON](https://tools.ietf.org/html/rfc7159)-encoded items (array) |  |

## Outbound foreign keys
- fork → forks.ID (fk_tickets_fork)
- ownergroup → groups.ID (fk_tickets_ownergroup)
- assigneduser → users.ID (fk_tickets_assigneduser)
- account → accounts.ID (fk_tickets_account)
- project → projects.ID (fk_tickets_project)

## Inbound references
- actionsteps.ticket → tickets.ID (fk_actionsteps_ticket)
- messages.ticket → tickets.ID (fk_messages_ticket)
- tasks.ticket → tickets.ID (fk_tasks_ticket)

---

# tokens (table)

API access tokens per user and application.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| user | integer | yes |  |  | users.ID (fk_tokens_user) |
| application | integer | no |  |  | applications.ID (fk_tokens_application) |
| token | bytea | yes |  |  |  |
| expdate | bigint | yes |  |  |  |
| type | smallint | yes | 0 |  |  |
| hint | text | yes | '' |  |  |
| challenge | bytea | no |  |  |  |

## Outbound foreign keys
- user → users.ID (fk_tokens_user)
- application → applications.ID (fk_tokens_application)

## Inbound references
- (none)

---

# transactions (table)

Billing and procurement transactions (quotes, orders, invoices).

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | integer | yes |  | Transaction ID |  |
| fork | integer | no |  | Fork ID (`null` for base module) | forks.ID (fk_transactions_fork) |
| ownergroup | integer | no |  | Owner group ID (`null`=PUBLIC) | groups.ID (fk_transactions_ownergroup) |
| creator | integer | no |  | Creator user ID (defaults to authenticated user on creation) |  |
| assigneduser | integer | no |  | Assigned user ID | users.ID (fk_transactions_assigneduser) |
| creationdate | bigint | yes | date_part('epoch', now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | date_part('epoch', now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| account | integer | no |  | Account ID | accounts.ID (fk_transactions_account) |
| item | integer | no |  | Item ID; must be `null` for BILLING and PROCUREMENT | items.ID (fk_transactions_item) |
| contract | integer | no |  | Contract ID | contracts.ID (fk_transactions_contract) |
| transactionnum | text | yes |  | Transaction number |  |
| type | smallint | yes | 0 | Transaction type (`0`=BILLING_QUOTE, `1`=BILLING_ORDER, `2`=BILLING_DELIVERY, `3`=BILLING_INVOICE, `4`=BILLING_CREDIT, `5`=PROCUREMENT_REQUEST, `6`=PROCUREMENT_ORDER, `7`=PROCUREMENT_DELIVERY, `8`=PROCUREMENT_INVOICE, `9`=PROCUREMENT_CREDIT, `10`=PRODUCTION_FABRICATION, `11`=PRODUCTION_DISASSEMBLY) |  |
| date | bigint | yes | date_part('epoch', now()) | Designated date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| duedate | bigint | no |  | Due date as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) |  |
| status | smallint | yes | 0 | Status (`0`=DRAFT, `1`=BOOKED, `2`=HOLD, `3`=CANCELLED, `4`=CLOSED, `5`=PARTLYORDERED, `6`=PARTLYORDERED_CANCELLED, `7`=PARTLYORDERED_CLOSED, `8`=ORDERED, `9`=PARTLYDELIVERED, `10`=PARTLYDELIVERED_CANCELLED, `11`=PARTLYDELIVERED_CLOSED, `12`=DELIVERED, `13`=PARTLYINVOICED, `14`=PARTLYINVOICED_CANCELLED, `15`=PARTLYINVOICED_CLOSED, `16`=INVOICED, `17`=PARTLYPAID, `18`=PARTLYPAID_CANCELLED, `19`=PARTLYPAID_CLOSED, `20`=PAID, `21`=OVERPAID, `22`=PROCESSED, `23`=PROCESSED_CANCELLED) |  |
| calculation | smallint | yes | 0 | Calculation method (`0`=NET, `1`=GROSS, `2`=EXACT, `3`=LEGACY, `4`=EXTERNAL) |  |
| productionfactor | integer | no |  | Production factor; is required for PRODUCTION, otherwise must be `null` |  |
| currency | character varying(3) | yes |  | Currency code ([ISO 4217](https://en.wikipedia.org/wiki/ISO_4217)) |  |
| exchangerate | double precision | yes | 1 | Exchange rate as a multiple of one monetary unit of the fixed system currency |  |
| taxid | text | yes | '' | Buyer Tax ID (e.g. VATIN or SSN) |  |
| shippingrecipient | text | yes | '' | Shipping recipient |  |
| shippingaddress | text | yes | '' | Shipping address (street and building/suite number) |  |
| shippingpostalcode | text | yes | '' | Shipping postal or ZIP code |  |
| shippingcity | text | yes | '' | Shipping city or locality |  |
| shippingregion | text | yes | '' | Shipping region or state |  |
| shippingcountry | character varying(2) | yes | '' | Shipping country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)) |  |
| billingrecipient | text | yes | '' | Billing recipient |  |
| billingaddress | text | yes | '' | Billing address (street and building/suite number) |  |
| billingpostalcode | text | yes | '' | Billing postal or ZIP code |  |
| billingcity | text | yes | '' | Billing city or locality |  |
| billingregion | text | yes | '' | Billing region or state |  |
| billingcountry | character varying(2) | yes | '' | Billing country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)) |  |
| sellertaxid | text | yes | '' | Seller Tax ID (e.g. VATIN or SSN) |  |
| sellername | text | yes | '' | Seller Name |  |
| selleraddress | text | yes | '' | Seller address (street and building/suite number) |  |
| sellerpostalcode | text | yes | '' | Seller postal or ZIP code |  |
| sellercity | text | yes | '' | Seller city or locality |  |
| sellerregion | text | yes | '' | Seller region or state |  |
| sellercountry | character varying(2) | yes | '' | Seller country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)) |  |
| discount | double precision | yes | 0 | Total absolute discount |  |
| netamount | double precision | yes | 0 | Total net amount |  |
| tax | double precision | yes | 0 | Total tax amount |  |
| margin | double precision | yes | 0 | Total absolute margin |  |
| weight | double precision | yes | 0 | Total shipping weight in kilograms (only positive line items) |  |
| items | json | no |  | [JSON](https://tools.ietf.org/html/rfc7159)-encoded items (array) |  |

## Outbound foreign keys
- fork → forks.ID (fk_transactions_fork)
- ownergroup → groups.ID (fk_transactions_ownergroup)
- assigneduser → users.ID (fk_transactions_assigneduser)
- account → accounts.ID (fk_transactions_account)
- item → items.ID (fk_transactions_item)
- contract → contracts.ID (fk_transactions_contract)

## Inbound references
- actionsteps.transaction → transactions.ID (fk_actionsteps_transaction)
- couponcodes.transaction → transactions.ID (fk_couponcodes_transaction)
- dunning2transactions.transaction → transactions.ID (fk_dunning2transactions_transaction)
- payments.transaction → transactions.ID (fk_payments_transaction)
- stocktransactions.transaction → transactions.ID (fk_stocktransactions_transaction)

---

# usagestats (table)

Platform usage statistics and metrics.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| date | bigint | yes |  |  |  |
| users | integer | yes |  |  |  |
| apiusers | integer | yes |  |  |  |
| dbtuples | bigint | yes |  |  |  |
| binsize | bigint | yes |  |  |  |
| fssize | bigint | yes |  |  |  |
| cpu | bigint | yes |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# userfields (table)

User-specific field display preferences.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| user | integer | yes |  |  | users.ID (fk_userfields_user) |
| fork | integer | no |  |  | forks.ID (fk_userfields_fork) |
| view | text | yes |  |  |  |
| name | text | yes |  |  |  |
| data | json | yes |  |  |  |

## Outbound foreign keys
- user → users.ID (fk_userfields_user)
- fork → forks.ID (fk_userfields_fork)

## Inbound references
- (none)

---

# userfilters (table)

Saved user filters for list views.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| user | integer | yes |  |  | users.ID (fk_userfilters_user) |
| fork | integer | no |  |  | forks.ID (fk_userfilters_fork) |
| view | text | yes |  |  |  |
| name | text | yes |  |  |  |
| data | json | yes |  |  |  |

## Outbound foreign keys
- user → users.ID (fk_userfilters_user)
- fork → forks.ID (fk_userfilters_fork)

## Inbound references
- (none)

---

# users (table)

User accounts with authentication and session management.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | integer | yes |  | User ID |  |
| creator | integer | no |  | Creator user ID (defaults to authenticated user on creation) |  |
| creationdate | bigint | yes | date_part('epoch', now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | date_part('epoch', now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| contact | integer | no |  | Contact ID | contacts.ID (fk_users_contact) |
| activity | smallint | yes | 0 | Activity (`0`=ACTIVE, `1`=DEACTIVATED, `2`=DELETED) |  |
| name | text | yes |  | Username (case-insensitively unique) |  |
| email | text | yes |  | System e-mail address (case-insensitively unique) |  |
| nopublic | smallint | yes | 0 | Deny access to public data |  |
| apionly | smallint | yes | 0 | Restricted to API access, no regular login |  |
| expdate | bigint | no |  | Expiry date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) |  |
| password | text | yes | '' |  |  |
| resetlogintoken | bytea | no |  |  |  |
| signature | bytea | no |  |  |  |
| description | text | yes | '' |  |  |
| otpsecret | bytea | no |  |  |  |
| settings | json | no |  |  |  |

## Outbound foreign keys
- contact → contacts.ID (fk_users_contact)

## Inbound references
- accounts.assigneduser → users.ID (fk_accounts_assigneduser)
- actionsteps.assigneduser → users.ID (fk_actionsteps_assigneduser)
- actionsteps.owneruser → users.ID (fk_actionsteps_owneruser)
- appointments.assigneduser → users.ID (fk_appointments_assigneduser)
- appointments.owneruser → users.ID (fk_appointments_owneruser)
- campaigns.assigneduser → users.ID (fk_campaigns_assigneduser)
- categories.owneruser → users.ID (fk_categories_owneruser)
- channels.owneruser → users.ID (fk_channels_owneruser)
- contacts.assigneduser → users.ID (fk_contacts_assigneduser)
- contacts.owneruser → users.ID (fk_contacts_owneruser)
- contracts.assigneduser → users.ID (fk_contracts_assigneduser)
- davservers.owneruser → users.ID (fk_davservers_owneruser)
- davservers.recipientuser → users.ID (fk_davservers_recipientuser)
- documents.assigneduser → users.ID (fk_documents_assigneduser)
- documents.owneruser → users.ID (fk_documents_owneruser)
- dunning.assigneduser → users.ID (fk_dunning_assigneduser)
- events.owneruser → users.ID (fk_events_owneruser)
- feedservers.owneruser → users.ID (fk_feedservers_owneruser)
- feedservers.recipientuser → users.ID (fk_feedservers_recipientuser)
- follows.creator → users.ID (fk_follows_creator)
- groups.leader → users.ID (fk_groups_leader)
- groups2users.user → users.ID (fk_groups2users_user)
- imports.user → users.ID (fk_imports_user)
- likes.creator → users.ID (fk_likes_creator)
- links.assigneduser → users.ID (fk_links_assigneduser)
- links.owneruser → users.ID (fk_links_owneruser)
- mailinglists.assigneduser → users.ID (fk_mailinglists_assigneduser)
- mailinglists.owneruser → users.ID (fk_mailinglists_owneruser)
- mailservers.owneruser → users.ID (fk_mailservers_owneruser)
- mailservers.recipientuser → users.ID (fk_mailservers_recipientuser)
- messagereads.creator → users.ID (fk_messagereads_creator)
- messages.owneruser → users.ID (fk_messages_owneruser)
- notes.assigneduser → users.ID (fk_notes_assigneduser)
- notes.owneruser → users.ID (fk_notes_owneruser)
- objects.assigneduser → users.ID (fk_objects_assigneduser)
- objects.owneruser → users.ID (fk_objects_owneruser)
- opportunities.assigneduser → users.ID (fk_opportunities_assigneduser)
- payments.assigneduser → users.ID (fk_payments_assigneduser)
- projects.assigneduser → users.ID (fk_projects_assigneduser)
- projects.owneruser → users.ID (fk_projects_owneruser)
- records.assigneduser → users.ID (fk_records_assigneduser)
- records.owneruser → users.ID (fk_records_owneruser)
- tasks.assigneduser → users.ID (fk_tasks_assigneduser)
- tasks.owneruser → users.ID (fk_tasks_owneruser)
- tickets.assigneduser → users.ID (fk_tickets_assigneduser)
- tokens.user → users.ID (fk_tokens_user)
- transactions.assigneduser → users.ID (fk_transactions_assigneduser)
- userfields.user → users.ID (fk_userfields_user)
- userfilters.user → users.ID (fk_userfilters_user)

---

# views (table)

User view configurations and layout preferences.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| user | integer | yes |  |  |  |
| view | text | yes |  |  |  |
| data | text | yes |  |  |  |
| fork | integer | no |  |  |  |

## Outbound foreign keys
- (none)

## Inbound references
- (none)

---

# weblets (table)

UI weblets for embedding custom views in ZeyOS.

## Fields
| Field | Type | Not null | Default | Description | References |
| ----- | ---- | -------- | ------- | ----------- | ---------- |
| ID | integer | yes |  | Weblet ID |  |
| creator | integer | no |  | Creator user ID (defaults to authenticated user on creation) |  |
| creationdate | bigint | yes | date_part('epoch', now()) | Creation date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (defaults to current date and time on creation) |  |
| lastmodified | bigint | yes | date_part('epoch', now()) | Last modification date and time as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time) (auto-reset on modification) |  |
| application | integer | no |  | Application ID (`null`=STANDALONE) | applications.ID (fk_weblets_application) |
| activity | smallint | yes | 0 | Activity (`0`=ACTIVE, `1`=DEACTIVATED, `2`=DELETED) |  |
| name | text | yes |  | Name |  |
| identifier | character varying(200) | yes |  | Unique weblet identifier |  |
| view | text | yes | '' | Canonical view |  |
| type | smallint | yes | 0 | Weblet type (`0`=INTEGRATED, `1`=STANDALONE, `2`=DETACHED, `3`=POPUP_FRAMED, `4`=POPUP_PLAIN, `5`=EMBEDDED_FRAMED, `6`=EMBEDDED_COLLAPSED, `7`=EMBEDDED_PLAIN) |  |
| width | smallint | yes | 0 | Width in pixels (`0`=100%) |  |
| height | smallint | yes | 0 | Height in pixels (`0`=100%) |  |
| svgpath | text | yes | '' | [SVG path](https://www.w3.org/TR/SVG11/paths.html) for icon (square) |  |
| color | character varying(6) | yes | '' | Color code (CSS-style hexadecimal without `#`) |  |
| mimetype | text | yes | 'text/x-zymba' | [MIME type](https://en.wikipedia.org/wiki/Media_type) ([RFC 2045](https://tools.ietf.org/html/rfc2045)) |  |
| langaliases | json | no |  | [JSON](https://tools.ietf.org/html/rfc7159)-encoded language-specific aliases (object); use language code as object key |  |
| binfile | integer | no |  |  | binfiles.ID (fk_weblets_binfile) |
| url | text | yes | '' |  |  |

## Outbound foreign keys
- application → applications.ID (fk_weblets_application)
- binfile → binfiles.ID (fk_weblets_binfile)

## Inbound references
- (none)
