hr.organization_units
Schema: hr
English table: hr.organization_units
Italian original table: hr.organigramma_det
Description: Organization chart units/nodes (tenant-scoped).
Overview
- Columns: 14
- Primary key: id
- Outgoing foreign keys: 5
- Incoming foreign keys: 2
- Indexes: 7
Columns
| English column | Italian original column | Type | Null | Default / Generated | Description |
|---|---|---|---|---|---|
id | id | integer | NO | Surrogate primary key. | |
ou_id | org_id | integer | NO | Business identifier of the organization unit (unique per tenant). | |
ou_organization_chart_id | org_orga_id | integer | NO | Organization chart identifier (references organization charts). | |
ou_parent_id | org_father_id | integer | YES | Parent organization unit identifier (for hierarchy). | |
ou_name | org_denominazione | character varying(60) | NO | Organization unit name. | |
ou_description | org_descrizione | text | NO | Organization unit description. | |
ou_role_id | org_ru_id | integer | YES | Default role associated with the organization unit (optional). | |
ou_type | org_tipo | integer | NO | Organization unit type code. | |
ou_job_profile_id | org_proatt_id | integer | YES | Job profile identifier associated with the organization unit (optional). | |
ou_workplace_id | org_sede_id | integer | YES | Workplace/site identifier associated with the organization unit (optional). | |
ou_manage_employees | org_gestisci_dip_nodo | boolean | NO | Indicates whether employees can be managed within this organization unit node. | |
tenant_id | tenant_id | integer | YES | Tenant identifier. | |
colcustom | colcustom | jsonb | YES | '{}'::jsonb | Custom fields (JSON). |
_deleted | _deleted | boolean | YES | false | Soft-delete flag. |
Relationships
Outgoing foreign keys
| Constraint | Local columns | References | Referenced columns | On update | On delete |
|---|---|---|---|---|---|
fk_org_role_id | ou_role_id, tenant_id | hr.positions | pos_code_id, tenant_id | RESTRICT | RESTRICT |
fk_ou_job_profile | ou_job_profile_id, tenant_id | hr.job_profiles | jp_code, tenant_id | RESTRICT | RESTRICT |
fk_ou_organization_chart | ou_organization_chart_id, tenant_id | hr.organization_charts | oc_code, tenant_id | RESTRICT | RESTRICT |
fk_ou_workplace | ou_workplace_id, tenant_id | hr.work_sites | sede_id, tenant_id | RESTRICT | RESTRICT |
fk_tenant_id | tenant_id | cloud.tenants | ten_internal_id | RESTRICT | CASCADE |
Referenced by
| From table | Foreign key | Source columns | Target columns |
|---|---|---|---|
hr.organigramma_gruppi | fk_orgag_org_id | orgag_org_id, tenant_id | ou_id, tenant_id |
hr.person_competency_assessments | fk_prcpca_org_unit_id | pca_org_unit_id, tenant_id | ou_id, tenant_id |
Constraints
- Primary key:
pk_organization_units→id - Unique:
uk_ou_tenant_ou→ou_id, tenant_id
Indexes
| Name | Unique | Method | Columns / expression |
|---|---|---|---|
idx_ou_tenant | NO | btree | tenant_id |
idx_ou_tenant_jobprofile | NO | btree | tenant_id, ou_job_profile_id) WHERE (_deleted = false |
idx_ou_tenant_orgchart | NO | btree | tenant_id, ou_organization_chart_id) WHERE (_deleted = false |
idx_ou_tenant_ou | NO | btree | tenant_id, ou_id) WHERE (_deleted = false |
idx_ou_tenant_parent | NO | btree | tenant_id, ou_parent_id) WHERE (_deleted = false |
idx_ou_tenant_role | NO | btree | tenant_id, ou_role_id) WHERE (_deleted = false |
idx_ou_tenant_workplace | NO | btree | tenant_id, ou_workplace_id) WHERE (_deleted = false |
Navigation
- Back to main index
- [Back to
hrindex]../)