Schema: hr
English table: hr.canteen_companies
Italian original table: hr.me_mensa_azienda
Description: External or internal companies whose members use the canteen service, used for service cost billing.
Overview
- Columns: 6
- Primary key: id
- Outgoing foreign keys: 1
- Incoming foreign keys: 1
- Indexes: 2
Columns
| English column | Italian original column | Type | Null | Default / Generated | Description |
|---|
id | id | integer | NO | | Surrogate primary key. |
cc_id | mensaaz_id | integer | NO | | Identifier of the related cc record. |
cc_description | mensaaz_descrizione | character varying(50) | NO | | Commercial name or description of the company for invoicing purposes. |
tenant_id | tenant_id | integer | YES | | Tenant identifier for data isolation. |
colcustom | colcustom | jsonb | YES | '{}'::jsonb | JSON payload containing additional attributes. |
_deleted | _deleted | boolean | YES | false | Flag indicating whether the record is soft-deleted. |
Relationships
Outgoing foreign keys
| Constraint | Local columns | References | Referenced columns | On update | On delete |
|---|
fk_cc_tenant | tenant_id | cloud.tenants | ten_internal_id | RESTRICT | CASCADE |
Referenced by
| From table | Foreign key | Source columns | Target columns |
|---|
hr.canteen_members | fk_cm_canteen_company | cm_canteen_company_id, tenant_id | cc_id, tenant_id |
Constraints
- Primary key:
pk_cc → id
- Unique:
uk_cc_id_tenant → cc_id, tenant_id
Indexes
| Name | Unique | Method | Columns / expression |
|---|
idx_cc_id_tenant | NO | btree | tenant_id, cc_id) WHERE (_deleted = false |
idx_cc_tenant | NO | btree | tenant_id |
Navigation