hr.customer_group_assignments
Schema: hr
English table: hr.customer_group_assignments
Italian original table: hr.in_clienti_gruppi
Description: Link table between customers and element groups for categorization purposes.
Overview
- Columns: 7
- Primary key: id
- Outgoing foreign keys: 3
- Incoming foreign keys: 0
- Indexes: 4
Columns
| English column | Italian original column | Type | Null | Default / Generated | Description |
|---|
id | id | integer | NO | | Internal surrogate primary key. |
cga_id | inclig_id | integer | NO | | Unique identifier for the assignment record within a tenant. |
cga_customer_id | inclig_incli_id | integer | NO | | Reference to the customer (in_clienti). |
cga_group_id | inclig_grp_id | integer | NO | | Reference to the element group (element_groups). |
tenant_id | tenant_id | integer | YES | | Tenant identifier for data isolation. |
colcustom | colcustom | jsonb | YES | '{}'::jsonb | JSON field for custom data/attributes. |
_deleted | _deleted | boolean | YES | false | Technical soft delete flag. |
Relationships
Outgoing foreign keys
| Constraint | Local columns | References | Referenced columns | On update | On delete |
|---|
fk_customer_group_assignments_customer | cga_customer_id, tenant_id | hr.customers | cust_id, tenant_id | RESTRICT | RESTRICT |
fk_customer_group_assignments_group | cga_group_id, tenant_id | hr.element_groups | eg_id, tenant_id | RESTRICT | RESTRICT |
fk_customer_group_assignments_tenant | tenant_id | cloud.tenants | ten_internal_id | RESTRICT | CASCADE |
Referenced by
No incoming foreign keys found.
Constraints
- Primary key:
pk_customer_group_assignments → id
- Unique:
uk_customer_group_assignments_id → cga_id, tenant_id
Indexes
| Name | Unique | Method | Columns / expression |
|---|
idx_cga_customer_tenant | NO | btree | tenant_id, cga_customer_id) WHERE (_deleted = false |
idx_cga_group_tenant | NO | btree | tenant_id, cga_group_id) WHERE (_deleted = false |
idx_cga_id_tenant | NO | btree | tenant_id, cga_id) WHERE (_deleted = false |
idx_cga_tenant | NO | btree | tenant_id |
Navigation