hr.customer_projects
Schema: hr
English table: hr.customer_projects
Italian original table: hr.in_commesse
Description: Management of projects or work orders linked to specific customers.
Overview
- Columns: 10
- Primary key: id
- Outgoing foreign keys: 1
- Incoming foreign keys: 3
- Indexes: 3
Columns
| English column | Italian original column | Type | Null | Default / Generated | Description |
|---|---|---|---|---|---|
id | id | integer | NO | Technical primary key (surrogate). | |
cpr_id | com_id | integer | NO | Functional identifier for the customer project. | |
cpr_code | com_code | character varying(50) | NO | Unique alphanumeric project code. | |
cpr_description | com_description | character varying(250) | NO | Full detailed description of the project. | |
cpr_is_enabled | com_enabled | boolean | NO | Flag indicating if the project is currently active. | |
cpr_short_description | com_short_descr | character varying(100) | NO | Abridged version of the project description. | |
cpr_cust_id | com_incli_id | integer | NO | Reference to the associated customer (cust_id in hr.customers). | |
tenant_id | tenant_id | integer | YES | Tenant identifier for data isolation. | |
colcustom | colcustom | jsonb | YES | '{}'::jsonb | JSON structure for custom fields. |
_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_projects_tenant | tenant_id | cloud.tenants | ten_internal_id | RESTRICT | CASCADE |
Referenced by
| From table | Foreign key | Source columns | Target columns |
|---|---|---|---|
hr.business_trips | fk_intra_com_id | btr_cpr_id, tenant_id | cpr_id, tenant_id |
hr.customer_project_activities | fk_customer_project_activities_cpr_id | cpa_cpr_id, tenant_id | cpr_id, tenant_id |
hr.customer_project_links | fk_customer_project_links_cpr_id | cpl_cpr_id, tenant_id | cpr_id, tenant_id |
Constraints
- Primary key:
pk_customer_projects→id - Unique:
uk_customer_projects_cpr_id→cpr_id, tenant_id
Indexes
| Name | Unique | Method | Columns / expression |
|---|---|---|---|
idx_cpr_cust_id_tenant | NO | btree | tenant_id, cpr_cust_id) WHERE (_deleted = false |
idx_cpr_id_tenant | NO | btree | tenant_id, cpr_id) WHERE (_deleted = false |
idx_cpr_tenant | NO | btree | tenant_id |
Navigation
- Back to main index
- [Back to
hrindex]../)