hr.employment_special_regulation_assignments
Schema: hr
English table: hr.employment_special_regulation_assignments
Italian original table: hr.rapporti_leggi_speciali
Description: Links employment relationships to special regulations (laws, benefits, exemptions) within specific timeframes.
Overview
- Columns: 10
- Primary key: id
- Outgoing foreign keys: 3
- Incoming foreign keys: 0
- Indexes: 6
Columns
| English column | Italian original column | Type | Null | Default / Generated | Description |
|---|---|---|---|---|---|
id | id | integer | NO | Internal surrogate primary key. | |
esra_id | raplegspe_id | integer | NO | Business identifier for the assignment, unique per tenant. | |
esra_employment_relationship_id | raplegspe_rap_id | integer | NO | Reference to the employment relationship. | |
esra_special_regulation_id | raplegspe_legspe_id | integer | NO | Reference to the specific regulation applied. | |
esra_valid_from | raplegspe_dal | date | NO | Start date of the regulation application. | |
esra_valid_to | raplegspe_al | date | NO | End date of the regulation application. | |
tenant_id | tenant_id | integer | YES | Tenant identifier for row ownership and RLS filtering. | |
colcustom | colcustom | jsonb | YES | '{}'::jsonb | Custom fields in JSON format. |
_deleted | _deleted | boolean | YES | false | Logical deletion flag. |
esra_period | raplegspe_periodo | daterange | YES | GENERATED: daterange(esra_valid_from, esra_valid_to, '[]'::text) | Temporal range (daterange) of validity, generated from start and end dates. |
Relationships
Outgoing foreign keys
| Constraint | Local columns | References | Referenced columns | On update | On delete |
|---|---|---|---|---|---|
fk_esra_employment_relationship | esra_employment_relationship_id, tenant_id | hr.employment_relationships | er_id, tenant_id | RESTRICT | CASCADE |
fk_esra_special_regulation | esra_special_regulation_id, tenant_id | hr.special_regulations | regulation_code_id, tenant_id | RESTRICT | RESTRICT |
fk_esra_tenant | tenant_id | cloud.tenants | ten_internal_id | RESTRICT | CASCADE |
Referenced by
No incoming foreign keys found.
Constraints
- Primary key:
pk_esra→id - Unique:
uk_esra_id_tenant→esra_id, tenant_id
Indexes
| Name | Unique | Method | Columns / expression |
|---|---|---|---|
idx_esra_emp_period_gist | NO | gist | tenant_id, esra_employment_relationship_id, esra_period) WHERE (_deleted = false |
idx_esra_emp_rel_tenant | NO | btree | tenant_id, esra_employment_relationship_id) WHERE (_deleted = false |
idx_esra_id_tenant | NO | btree | tenant_id, esra_id) WHERE (_deleted = false |
idx_esra_period_gist | NO | gist | tenant_id, esra_period) WHERE (_deleted = false |
idx_esra_spec_reg_tenant | NO | btree | tenant_id, esra_special_regulation_id) WHERE (_deleted = false |
idx_esra_tenant | NO | btree | tenant_id |
Navigation
- Back to main index
- [Back to
hrindex]../)