hr.organization_charts
Schema: hr
English table: hr.organization_charts
Italian original table: hr.organigrammi
Description: Organization charts defined for a company with validity dates (multi-tenant).
Overview
- Columns: 14
- Primary key: id
- Outgoing foreign keys: 2
- Incoming foreign keys: 1
- Indexes: 4
Columns
| English column | Italian original column | Type | Null | Default / Generated | Description |
|---|---|---|---|---|---|
id | id | integer | NO | Surrogate primary key. | |
oc_code | orga_id | integer | NO | Business identifier for the organization chart (unique per tenant). | |
oc_company_id | orga_az_id | integer | NO | Company identifier the organization chart belongs to. | |
oc_name | orga_denominazione | character varying(60) | NO | Organization chart name. | |
oc_description | orga_descrizione | text | NO | Organization chart description. | |
oc_valid_from | orga_dalla_data | date | NO | Start date (inclusive) of the organization chart validity. | |
oc_valid_to | orga_alla_data | date | NO | End date (inclusive) of the organization chart validity. | |
oc_is_active | orga_attivo | boolean | NO | Whether the organization chart is active. | |
oc_events_enabled | orga_eventi_gestiti | boolean | NO | Whether event management is enabled for this organization chart. | |
oc_is_visible_to_all | orga_alldip | boolean | NO | Whether the organization chart is visible to all employees. | |
tenant_id | tenant_id | integer | YES | Tenant identifier. | |
colcustom | colcustom | jsonb | YES | '{}'::jsonb | Custom fields stored as JSON. |
_deleted | _deleted | boolean | YES | false | Soft delete flag (technical). |
oc_valid_period | orga_periodo | daterange | YES | GENERATED: daterange(oc_valid_from, oc_valid_to, '[]'::text) | Generated validity period as a daterange derived from valid_from and valid_to (inclusive). |
Relationships
Outgoing foreign keys
| Constraint | Local columns | References | Referenced columns | On update | On delete |
|---|---|---|---|---|---|
fk_oc_company_id | oc_company_id, tenant_id | hr.companies | cmp_id, tenant_id | RESTRICT | RESTRICT |
fk_oc_tenant_id | tenant_id | cloud.tenants | ten_internal_id | RESTRICT | CASCADE |
Referenced by
| From table | Foreign key | Source columns | Target columns |
|---|---|---|---|
hr.organization_units | fk_ou_organization_chart | ou_organization_chart_id, tenant_id | oc_code, tenant_id |
Constraints
- Primary key:
pk_organization_charts→id - Unique:
uk_oc_code_tenant→oc_code, tenant_id
Indexes
| Name | Unique | Method | Columns / expression |
|---|---|---|---|
idx_oc_tenant | NO | btree | tenant_id |
idx_oc_tenant_code | NO | btree | tenant_id, oc_code) WHERE (_deleted = false |
idx_oc_tenant_company | NO | btree | tenant_id, oc_company_id) WHERE (_deleted = false |
idx_oc_tenant_period_gist | NO | gist | tenant_id, oc_valid_period) WHERE (_deleted = false |
Navigation
- Back to main index
- [Back to
hrindex]../)