Columns
| Column | Type | Size | Nulls | Auto | Default | Children | Parents | Comments | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| booking_id | int4 | 10 | null |
|
|
||||||||||||||||||
| booking_seq | int4 | 10 | null |
|
|
||||||||||||||||||
| rateplan_id | int4 | 10 | null |
|
|
||||||||||||||||||
| roomtype_id | int4 | 10 | null |
|
|
||||||||||||||||||
| bedtype_id | int4 | 10 | √ | null |
|
|
|||||||||||||||||
| arrival | date | 13 | null |
|
|
||||||||||||||||||
| departure | date | 13 | null |
|
|
||||||||||||||||||
| qty | int2 | 5 | null |
|
|
||||||||||||||||||
| adult | int2 | 5 | 2 |
|
|
||||||||||||||||||
| child | int2 | 5 | 0 |
|
|
||||||||||||||||||
| infant | int2 | 5 | 0 |
|
|
||||||||||||||||||
| allot_qty | int2 | 5 | √ | 0 |
|
|
|||||||||||||||||
| block_qty | int2 | 5 | 0 |
|
|
||||||||||||||||||
| inhouse_qty | int2 | 5 | 0 |
|
|
||||||||||||||||||
| charge_to | bpchar | 1 | 'B'::bpchar |
|
|
||||||||||||||||||
| extra_adult | int2 | 5 | 0 |
|
|
||||||||||||||||||
| extra_child | int2 | 5 | 0 |
|
|
||||||||||||||||||
| extra_infant | int2 | 5 | 0 |
|
|
||||||||||||||||||
| no_amend | bool | 1 | √ | false |
|
|
|||||||||||||||||
| no_cancel | bool | 1 | √ | false |
|
|
|||||||||||||||||
| no_refund | bool | 1 | √ | false |
|
|
|||||||||||||||||
| room_numbers | text | 2147483647 | √ | null |
|
|
|||||||||||||||||
| rate_id | int4 | 10 | √ | null |
|
|
|||||||||||||||||
| item_id | int4 | 10 | √ | null |
|
|
|||||||||||||||||
| rooms | _text | 2147483647 | √ | null |
|
|
|||||||||||||||||
| promotion_id | int4 | 10 | √ | null |
|
|
|||||||||||||||||
| noshow_qty | int2 | 5 | 0 |
|
|
||||||||||||||||||
| pax | text | 2147483647 | √ | fn_pax((adult + extra_adult), (child + extra_child), (infant + extra_infant)) |
|
|
|||||||||||||||||
| mealtype_id | int4 | 10 | √ | null |
|
|
|||||||||||||||||
| included_adult | int2 | 5 | √ | (adult - extra_adult) |
|
|
|||||||||||||||||
| included_child | int2 | 5 | √ | (child - extra_child) |
|
|
|||||||||||||||||
| included_infant | int2 | 5 | √ | (infant - extra_infant) |
|
|
|||||||||||||||||
| room_charge | t_money | 15,2 | √ | null |
|
|
|||||||||||||||||
| other_charge | t_money | 15,2 | √ | null |
|
|
|||||||||||||||||
| extra_charge | t_money | 15,2 | √ | null |
|
|
|||||||||||||||||
| total_charge | t_money | 15,2 | √ | ((COALESCE((room_charge)::numeric, (0)::numeric) + COALESCE((other_charge)::numeric, (0)::numeric)) + COALESCE((extra_charge)::numeric, (0)::numeric)) |
|
|
|||||||||||||||||
| namelist_group | int4 | 10 | √ | null |
|
|
|||||||||||||||||
| namelist_orig_seq | int4 | 10 | √ | null |
|
|
|||||||||||||||||
| namelist_add | bool | 1 | false |
|
|
||||||||||||||||||
| namelist_group_key | int8 | 19 | √ | (hashtext((((((((((((((((((((((((rateplan_id)::text || '|'::text) || (roomtype_id)::text) || '|'::text) || ((arrival - '2000-01-01'::date))::text) || '|'::text) || ((departure - '2000-01-01'::date))::text) || '|'::text) || (adult)::text) || '|'::text) || (child)::text) || '|'::text) || (infant)::text) || '|'::text) || (extra_adult)::text) || '|'::text) || (extra_child)::text) || '|'::text) || (extra_infant)::text) || '|'::text) || (charge_to)::text) || '|'::text) || (((COALESCE((room_charge)::numeric, 0.0) + COALESCE((extra_charge)::numeric, 0.0)) + COALESCE((other_charge)::numeric, 0.0)))::text)))::bigint |
|
|
|||||||||||||||||
| namelist_status | bpchar | 1 | √ | CASE WHEN (inhouse_qty > 0) THEN 'I'::text WHEN (block_qty > 0) THEN 'B'::text WHEN (noshow_qty > 0) THEN 'N'::text ELSE 'L'::text END |
|
|
I=In-house, B=Blocked, N=No-show, L=Listed |
||||||||||||||||
| split_folio | bool | 1 | false |
|
|
||||||||||||||||||
| bool | 1 | false |
|
|
Indexes
| Constraint Name | Type | Sort | Column(s) |
|---|---|---|---|
| pk_booking_items | Primary key | Asc | item_id |
| idx_booking_items_bedtype_id | Performance | Asc | bedtype_id |
| idx_booking_items_booking_id | Performance | Asc | booking_id |
| idx_booking_items_mealtype_id | Performance | Asc | mealtype_id |
| idx_booking_items_namelist_group_key | Performance | Asc/Asc | booking_id + namelist_group_key |
| idx_booking_items_promotion_id | Performance | Asc | promotion_id |
| idx_booking_items_rateplan_id | Performance | Asc | rateplan_id |
| idx_booking_items_roomtype_id | Performance | Asc | roomtype_id |
| unq_booking_items | Must be unique | Asc/Asc | booking_id + booking_seq |
Check Constraints
| Constraint Name | Constraint |
|---|---|
| chk_namelist_charge_to | (charge_to = ANY (ARRAY['B'::bpchar, 'O'::bpchar])) |

