Schema: hr
English table: hr.benefits
Italian original table: hr.benefit
Description: Benefit types / catalogue (lookup) used to assign benefits to employees.
Overview
- Columns: 6
- Primary key: id
- Outgoing foreign keys: 1
- Incoming foreign keys: 1
- Indexes: 2
Columns
| English column | Italian original column | Type | Null | Default / Generated | Description |
|---|
id | id | integer | NO | | Surrogate primary key. |
bft_id | ben_id | integer | NO | | Logical benefit identifier (unique per tenant). |
bft_description | ben_description | character varying(100) | NO | | Benefit description/name. |
tenant_id | tenant_id | integer | YES | | Tenant identifier for data isolation. |
colcustom | colcustom | jsonb | YES | '{}'::jsonb | Custom fields in JSON format. |
_deleted | _deleted | boolean | YES | false | Technical soft-delete flag. |
Relationships
Outgoing foreign keys
| Constraint | Local columns | References | Referenced columns | On update | On delete |
|---|
fk_benefits_tenant | tenant_id | cloud.tenants | ten_internal_id | RESTRICT | CASCADE |
Referenced by
| From table | Foreign key | Source columns | Target columns |
|---|
hr.person_benefits | fk_pbn_benefit | pbn_benefit_id, tenant_id | bft_id, tenant_id |
Constraints
- Primary key:
benefits_pkey → id
- Unique:
uk_bft_id_tenant → bft_id, tenant_id
Indexes
| Name | Unique | Method | Columns / expression |
|---|
idx_bft_tenant | NO | btree | tenant_id |
idx_bft_tenant_bft | NO | btree | tenant_id, bft_id) WHERE (_deleted = false |
Navigation