hr.person_group_assignments
Schema: hr
English table: hr.person_group_assignments
Italian original table: hr.ana_gruppi
Description: Temporal assignment of persons (employees) to groups with a percentage allocation, typically linked to employment relationships.
Overview
- Columns: 11
- Primary key: id
- Outgoing foreign keys: 1
- Incoming foreign keys: 0
- Indexes: 6
Columns
| English column | Italian original column | Type | Null | Default / Generated | Description |
|---|---|---|---|---|---|
id | id | integer | NO | Primary key identifier for the person-group assignment record. | |
person_group_assignment_id | anag_id | integer | NO | Internal reference ID for the group assignment. | |
person_group_relationship_id | anag_rap_id | integer | NO | Foreign key referencing the employment relationship (rapporto) of the person. | |
person_group_group_id | anag_grp_id | integer | NO | Foreign key referencing the group (gruppo) to which the person is assigned. | |
person_group_assigned_from | anag_data | date | NO | Start date of the group assignment. | |
person_group_percentage | anag_percentage | numeric(3,0) | NO | Percentage allocation of the person to this group (0-100). | |
tenant_id | tenant_id | integer | YES | Multi‑tenant isolation column. References cloud._tenant. | |
colcustom | colcustom | jsonb | YES | '{}'::jsonb | JSONB field for custom, tenant‑specific extensions. |
_deleted | _deleted | boolean | YES | false | Soft‑delete flag. When true, the record is considered logically deleted. |
person_group_assigned_to | anag_al | date | YES | End date of the group assignment (optional, can be NULL for open-ended assignments). | |
person_group_assignment_period | anag_periodo | daterange | YES | GENERATED: daterange(person_group_assigned_from, person_group_assigned_to, '[]'::text) | Generated daterange column combining assigned_from and assigned_to for efficient range queries. |
Relationships
Outgoing foreign keys
| Constraint | Local columns | References | Referenced columns | On update | On delete |
|---|---|---|---|---|---|
fk_person_group_assignments_tenant | tenant_id | cloud.tenants | ten_internal_id | RESTRICT | CASCADE |
Referenced by
No incoming foreign keys found.
Constraints
- Primary key:
pk_person_group_assignments→id - Unique:
uk_person_group_assignments_assignment_tenant→person_group_assignment_id, tenant_id
Indexes
| Name | Unique | Method | Columns / expression |
|---|---|---|---|
idx_pga_tenant | NO | btree | tenant_id |
idx_pga_tenant_assignment | NO | btree | tenant_id, person_group_assignment_id) WHERE (_deleted = false |
idx_pga_tenant_group | NO | btree | tenant_id, person_group_group_id) WHERE (_deleted = false |
idx_pga_tenant_period_gist | NO | gist | tenant_id, person_group_assignment_period) WHERE (_deleted = false |
idx_pga_tenant_relationship | NO | btree | tenant_id, person_group_relationship_id) WHERE (_deleted = false |
idx_pga_tenant_relationship_period_gist | NO | gist | tenant_id, person_group_relationship_id, person_group_assignment_period) WHERE (_deleted = false |
Navigation
- Back to main index
- [Back to
hrindex]../)