hr.document_model_permissions
Schema: hr
English table: hr.document_model_permissions
Italian original table: hr.in_permission
Description: Defines time windows during which specific document models can be requested for a given validity period.
Overview
- Columns: 13
- Primary key: id
- Outgoing foreign keys: 2
- Incoming foreign keys: 0
- Indexes: 8
Columns
| English column | Italian original column | Type | Null | Default / Generated | Description |
|---|---|---|---|---|---|
id | id | integer | NO | Internal surrogate primary key. | |
dmp_id | pe_id | integer | NO | Unique identifier for the permission rule within a tenant. | |
dmp_organization_unit_id | pe_org_id | integer | NO | Reference to the organization unit this rule applies to. | |
dmp_document_model_id | pe_dm_id | integer | NO | Reference to the document model/type. | |
dmp_valid_from | pe_dal | date | NO | Start of the period the document can refer to (e.g., start of holidays). | |
dmp_valid_to | pe_al | date | NO | End of the period the document can refer to (e.g., end of holidays). | |
dmp_requestable_from | pe_richiedi_dal | date | NO | Start of the window when the user is allowed to submit the request. | |
dmp_requestable_to | pe_richiedi_al | date | NO | End of the window when the user is allowed to submit the request. | |
dmp_employment_id | pe_rap_id | integer | NO | Reference to a specific employment if the rule is not global/unit-based. | |
tenant_id | tenant_id | integer | YES | Tenant identifier for data isolation. | |
colcustom | colcustom | jsonb | YES | '{}'::jsonb | JSON field for custom data. |
_deleted | _deleted | boolean | YES | false | Technical soft delete flag. |
dmp_validity_period | pe_periodo | daterange | YES | GENERATED: daterange(dmp_valid_from, dmp_valid_to, '[]'::text) | Generated daterange for the validity period. |
Relationships
Outgoing foreign keys
| Constraint | Local columns | References | Referenced columns | On update | On delete |
|---|---|---|---|---|---|
fk_document_model_permissions_model | dmp_document_model_id, tenant_id | hr.document_models | dmdl_id, tenant_id | RESTRICT | RESTRICT |
fk_document_model_permissions_tenant | tenant_id | cloud.tenants | ten_internal_id | RESTRICT | CASCADE |
Referenced by
No incoming foreign keys found.
Constraints
- Primary key:
pk_document_model_permissions→id - Unique:
uk_document_model_permissions_id→dmp_id, tenant_id
Indexes
| Name | Unique | Method | Columns / expression |
|---|---|---|---|
idx_dmp_document_model_tenant | NO | btree | tenant_id, dmp_document_model_id) WHERE (_deleted = false |
idx_dmp_employment_tenant | NO | btree | tenant_id, dmp_employment_id) WHERE (_deleted = false |
idx_dmp_id_tenant | NO | btree | tenant_id, dmp_id) WHERE (_deleted = false |
idx_dmp_organization_unit_tenant | NO | btree | tenant_id, dmp_organization_unit_id) WHERE (_deleted = false |
idx_dmp_tenant | NO | btree | tenant_id |
idx_dmp_tenant_employment_period_gist | NO | gist | tenant_id, dmp_employment_id, dmp_validity_period) WHERE (_deleted = false |
idx_dmp_tenant_org_period_gist | NO | gist | tenant_id, dmp_organization_unit_id, dmp_validity_period) WHERE (_deleted = false |
idx_dmp_tenant_period_gist | NO | gist | tenant_id, dmp_validity_period) WHERE (_deleted = false |
Navigation
- Back to main index
- [Back to
hrindex]../)