Schema: hr
English table: hr.equipment
Italian original table: hr.dotazioni
Description: Company equipment and assets catalog. Defines equipment items that can be assigned to employees (e.g., laptops, phones, vehicles, tools, protective gear, uniforms). Each item has a type, description, and optional expiration tracking.
Overview
- Columns: 9
- Primary key: id
- Outgoing foreign keys: 2
- Incoming foreign keys: 1
- Indexes: 3
Columns
| English column | Italian original column | Type | Null | Default / Generated | Description |
|---|
id | id | integer | NO | | Primary key (internal surrogate ID). |
eq_id | dot_id | integer | NO | | Business identifier for the equipment item (unique within tenant). |
eq_type_id | dot_tipdo_id | integer | NO | | Equipment type identifier (references hr.tipi_dotazioni → future: hr.equipment_types). |
eq_description | dot_description | character varying(50) | NO | | Equipment description or name (e.g., "MacBook Pro 14", "Safety Helmet", "Company Car Fiat 500"). |
eq_has_expiration | dot_enebled_expiration | boolean | NO | | Flag indicating whether this equipment has an expiration date (e.g., certifications, licenses, safety gear with validity periods). |
eq_validity_months | dot_month_validity | numeric(3,0) | NO | | Validity period in months for equipment with expiration enabled (e.g., 12 months for annual certifications, 36 months for vehicle leases). |
tenant_id | tenant_id | integer | YES | | Tenant identifier for multi-tenancy (references cloud._tenant). |
colcustom | colcustom | jsonb | YES | '{}'::jsonb | JSON object for custom fields and tenant-specific extensions. |
_deleted | _deleted | boolean | YES | false | Soft delete flag for technical deletion (not functional cancellation). |
Relationships
Outgoing foreign keys
| Constraint | Local columns | References | Referenced columns | On update | On delete |
|---|
fk_equipment_tenant | tenant_id | cloud.tenants | ten_internal_id | RESTRICT | CASCADE |
fk_equipment_type | eq_type_id, tenant_id | hr.equipment_types | eqt_id, tenant_id | RESTRICT | RESTRICT |
Referenced by
| From table | Foreign key | Source columns | Target columns |
|---|
hr.equipment_assignments | fk_eqa_equipment | eqa_equipment_id, tenant_id | eq_id, tenant_id |
Constraints
- Primary key:
pk_equipment → id
- Unique:
uk_equipment_eq_id_tenant → eq_id, tenant_id
Indexes
| Name | Unique | Method | Columns / expression |
|---|
idx_eq_tenant | NO | btree | tenant_id |
idx_eq_tenant_eq_id | NO | btree | tenant_id, eq_id) WHERE (_deleted = false |
idx_eq_tenant_type | NO | btree | tenant_id, eq_type_id) WHERE (_deleted = false |
Navigation