hr.companies
Schema: hr
English table: hr.companies
Italian original table: hr.aziende
Description: Companies managed in the HR system, including legal and payroll identifiers.
Overview
- Columns: 20
- Primary key: id
- Outgoing foreign keys: 1
- Incoming foreign keys: 5
- Indexes: 3
Columns
| English column | Italian original column | Type | Null | Default / Generated | Description |
|---|---|---|---|---|---|
id | id | integer | NO | Surrogate primary key. | |
cmp_id | az_id | integer | NO | Company internal identifier, unique per tenant. | |
cmp_name | az_denominazione | character varying(60) | NO | Registered company name. | |
cmp_legal_address | az_indirizzo_legale | character varying(60) | NO | Legal registered address. | |
cmp_legal_postal_code | az_cap_legale | character varying(5) | NO | Postal code of the legal registered address. | |
cmp_legal_city | az_comune_legale | character varying(60) | NO | City of the legal registered address. | |
cmp_legal_province | az_provincia_legale | character varying(2) | NO | Province code of the legal registered address. | |
cmp_contract_id | az_con_id | integer | NO | Reference to the national contract applied by the company. | |
cmp_code | az_codice | character varying(6) | NO | Short internal company code. | |
cmp_tax_code | az_codice_fiscale | character varying(16) | NO | Italian tax code (Codice Fiscale) of the company. | |
cmp_inps_registration_number | az_matricola_inps | character varying(16) | NO | INPS registration number (matricola) of the company. | |
cmp_payroll_code | az_codice_paghe | character varying(10) | NO | Payroll system code for the company. | |
cmp_meridiana_code | az_codice_meridiana | character varying(6) | NO | Meridiana integration code for the company. | |
cmp_vat_number | az_piva | character varying(11) | NO | VAT number (Partita IVA) of the company. | |
cmp_ateco_code | az_code_ateco | character varying(10) | NO | ATECO classification code. | |
cmp_rea_code | az_code_rea | character varying(15) | NO | REA registration code. | |
cmp_social_security_position | az_pos_previdenziale | character varying(10) | NO | Social security position/registration reference. | |
tenant_id | az_codice_logicos | integer | YES | Tenant identifier. | |
colcustom | tenant_id | jsonb | YES | '{}'::jsonb | Custom fields in JSON format. |
_deleted | colcustom | boolean | YES | false | Soft delete flag. |
Relationships
Outgoing foreign keys
| Constraint | Local columns | References | Referenced columns | On update | On delete |
|---|---|---|---|---|---|
fk_companies_tenant_id | tenant_id | cloud.tenants | ten_internal_id | RESTRICT | CASCADE |
Referenced by
| From table | Foreign key | Source columns | Target columns |
|---|---|---|---|
hr.company_work_sites | fk_sedel_az_id | cws_company_id, tenant_id | cmp_id, tenant_id |
hr.employment_relationships | fk_employment_relationships_company | er_company_id, tenant_id | cmp_id, tenant_id |
hr.organization_charts | fk_oc_company_id | oc_company_id, tenant_id | cmp_id, tenant_id |
pres.company_attendance_profiles | fk_prof_az_profaz_az_id_to_aziende | tenant_id, cap_company_id | tenant_id, cmp_id |
pres.leave_transformation_rules | fk_cnf_ferie_rule_fer_az_id_to_aziende | tenant_id, ltr_company_id | tenant_id, cmp_id |
Constraints
- Primary key:
pk_companies→id - Unique:
aziende_tenant_id_key→tenant_id, cmp_id - Unique:
uk_companies_cmp_id_tenant→cmp_id, tenant_id
Indexes
| Name | Unique | Method | Columns / expression |
|---|---|---|---|
idx_companies_tenant | NO | btree | tenant_id |
idx_companies_tenant_cmp | NO | btree | tenant_id, cmp_id) WHERE (_deleted = false |
idx_companies_tenant_contract | NO | btree | tenant_id, cmp_contract_id) WHERE (_deleted = false |
Navigation
- Back to main index
- [Back to
hrindex]../)