Schema: hr
English table: hr.room_amenities
Italian original table: hr.in_riu_properties_luoghi
Description: Link table between rooms and properties, specifying the quantity of each amenity available in a specific room.
Overview
- Columns: 8
- 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 | | Surrogate primary key. |
ra_id | riulpl_id | integer | NO | | Identifier of the related ra record. |
ra_room_id | riulpl_riul_id | integer | NO | | Identifier of the related ra room record. |
ra_property_id | riulpl_riup_id | integer | NO | | Identifier of the related ra property record. |
ra_quantity | riulpl_prp_qta | integer | NO | | The number of units available for the associated property in this room (e.g., 10 chairs). |
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_ra_property | ra_property_id, tenant_id | hr.room_properties | rp_id, tenant_id | RESTRICT | RESTRICT |
fk_ra_room | ra_room_id, tenant_id | hr.rooms | rm_id, tenant_id | RESTRICT | RESTRICT |
fk_ra_tenant | tenant_id | cloud.tenants | ten_internal_id | RESTRICT | CASCADE |
Referenced by
No incoming foreign keys found.
Constraints
- Primary key:
pk_room_amenities → id
- Unique:
uk_room_amenities_id → ra_id, tenant_id
Indexes
| Name | Unique | Method | Columns / expression |
|---|
idx_ra_id_tenant | NO | btree | tenant_id, ra_id) WHERE (_deleted = false |
idx_ra_property_tenant | NO | btree | tenant_id, ra_property_id) WHERE (_deleted = false |
idx_ra_room_tenant | NO | btree | tenant_id, ra_room_id) WHERE (_deleted = false |
idx_ra_tenant | NO | btree | tenant_id |
Navigation