Schema: hr
English table: hr.cost_groups
Italian original table: hr.gruppi_costi
Description: Cost groups for categorizing and organizing costs and expenses. Used to group related costs for reporting, budgeting, and analysis purposes (e.g., "Personnel Costs", "Operational Costs", "Training Costs", "Benefits Costs").
Overview
- Columns: 7
- Primary key: id
- Outgoing foreign keys: 1
- Incoming foreign keys: 0
- Indexes: 2
Columns
| English column | Italian original column | Type | Null | Default / Generated | Description |
|---|
id | id | integer | NO | | Primary key (internal surrogate ID). |
cg_id | grpcos_id | integer | NO | | Business identifier for the cost group (unique within tenant). |
cg_name | grpcos_denominazione | character varying(60) | NO | | Cost group name (e.g., "Personnel Costs", "Operational Expenses", "Training & Development"). |
cg_description | grpcos_descrizione | text | NO | | Detailed description of the cost group, explaining what types of costs are included and the purpose of this grouping. |
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_cg_tenant | tenant_id | cloud.tenants | ten_internal_id | RESTRICT | CASCADE |
Referenced by
No incoming foreign keys found.
Constraints
- Primary key:
pk_cost_groups → id
- Unique:
uk_cost_groups_cg_id_tenant → cg_id, tenant_id
Indexes
| Name | Unique | Method | Columns / expression |
|---|
idx_cg_tenant | NO | btree | tenant_id |
idx_cg_tenant_cg_id | NO | btree | tenant_id, cg_id) WHERE (_deleted = false |
Navigation