Skip to main content

hr.equipment_assignments

Schema: hr
English table: hr.equipment_assignments
Italian original table: hr.dotazioni_link
Description: Equipment assignments to employees. Tracks which equipment is assigned to which employee, the assignment period, expiration date, and notes. Examples: laptop assigned to developer, safety helmet to construction worker, company car to sales manager.

Overview

  • Columns: 12
  • Primary key: id
  • Outgoing foreign keys: 3
  • Incoming foreign keys: 0
  • Indexes: 7

Columns

English columnItalian original columnTypeNullDefault / GeneratedDescription
ididintegerNOPrimary key (internal surrogate ID).
eqa_iddotli_idintegerNOBusiness identifier for the equipment assignment (unique within tenant).
eqa_employment_iddotli_rap_idintegerNOEmployment relationship identifier (references hr.employment_relationships.rap_id).
eqa_equipment_iddotli_dot_idintegerNOEquipment item identifier (references hr.equipment.eq_id).
eqa_assigned_fromdotli_daldateNOAssignment start date (when the equipment was given to the employee).
eqa_expires_ondotli_data_scadenzadateNOExpiration date for equipment requiring periodic renewal (e.g., certification expiry, license renewal, lease end). May differ from assignment end date.
eqa_notesdotli_notetextNOAdditional notes about the assignment (e.g., condition at delivery, serial number, special terms).
tenant_idtenant_idintegerYESTenant identifier for multi-tenancy (references cloud._tenant).
colcustomcolcustomjsonbYES'{}'::jsonbJSON object for custom fields and tenant-specific extensions.
_deleted_deletedbooleanYESfalseSoft delete flag for technical deletion (not functional cancellation).
eqa_assigned_todotli_aldateYESAssignment end date (when the equipment was returned or assignment ended). NULL means currently assigned.
eqa_assignment_perioddotli_periododaterangeYESGENERATED: daterange(eqa_assigned_from, eqa_assigned_to, '[]'::text)Assignment period as daterange (auto-generated from eqa_assigned_from and eqa_assigned_to). Used for temporal queries and overlap detection.

Relationships

Outgoing foreign keys

ConstraintLocal columnsReferencesReferenced columnsOn updateOn delete
fk_eqa_employmenteqa_employment_id, tenant_idhr.employment_relationshipser_id, tenant_idRESTRICTCASCADE
fk_eqa_equipmenteqa_equipment_id, tenant_idhr.equipmenteq_id, tenant_idRESTRICTRESTRICT
fk_eqa_tenanttenant_idcloud.tenantsten_internal_idRESTRICTCASCADE

Referenced by

No incoming foreign keys found.

Constraints

  • Primary key: pk_equipment_assignmentsid
  • Unique: uk_equipment_assignments_eqa_id_tenanteqa_id, tenant_id

Indexes

NameUniqueMethodColumns / expression
idx_eqa_tenantNObtreetenant_id
idx_eqa_tenant_emplNObtreetenant_id, eqa_employment_id) WHERE (_deleted = false
idx_eqa_tenant_empl_period_gistNOgisttenant_id, eqa_employment_id, eqa_assignment_period) WHERE (_deleted = false
idx_eqa_tenant_eqa_idNObtreetenant_id, eqa_id) WHERE (_deleted = false
idx_eqa_tenant_equipNObtreetenant_id, eqa_equipment_id) WHERE (_deleted = false
idx_eqa_tenant_expiresNObtreetenant_id, eqa_expires_on) WHERE (_deleted = false
idx_eqa_tenant_period_gistNOgisttenant_id, eqa_assignment_period) WHERE (_deleted = false