Columns
| Column | Type | Size | Nulls | Auto | Default | Children | Parents | Comments | |||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id | int4 | 10 | √ | null |
|
|
|||||||||||||||||||||||||||||||||||||||||
| status | bpchar | 1 | √ | 'I'::bpchar |
|
|
I = In-house O = Checked out X = Cancel check-in |
||||||||||||||||||||||||||||||||||||||||
| booking_id | int4 | 10 | √ | null |
|
|
|||||||||||||||||||||||||||||||||||||||||
| booking_item | int4 | 10 | √ | null |
|
|
|||||||||||||||||||||||||||||||||||||||||
| room_id | int4 | 10 | √ | null |
|
|
|||||||||||||||||||||||||||||||||||||||||
| guest_id | int4 | 10 | √ | null |
|
|
|||||||||||||||||||||||||||||||||||||||||
| group_id | int4 | 10 | √ | null |
|
|
|||||||||||||||||||||||||||||||||||||||||
| arrival | date | 13 | null |
|
|
||||||||||||||||||||||||||||||||||||||||||
| departure | date | 13 | null |
|
|
||||||||||||||||||||||||||||||||||||||||||
| departure_time | time | 15,6 | √ | null |
|
|
|||||||||||||||||||||||||||||||||||||||||
| walk_in | bool | 1 | false |
|
|
||||||||||||||||||||||||||||||||||||||||||
| adult | int2 | 5 | 2 |
|
|
||||||||||||||||||||||||||||||||||||||||||
| child | int2 | 5 | 0 |
|
|
||||||||||||||||||||||||||||||||||||||||||
| infant | int2 | 5 | 0 |
|
|
||||||||||||||||||||||||||||||||||||||||||
| extra_adult | int2 | 5 | 0 |
|
|
||||||||||||||||||||||||||||||||||||||||||
| extra_child | int2 | 5 | 0 |
|
|
||||||||||||||||||||||||||||||||||||||||||
| extra_infant | int2 | 5 | 0 |
|
|
||||||||||||||||||||||||||||||||||||||||||
| approved | bool | 1 | false |
|
|
||||||||||||||||||||||||||||||||||||||||||
| approve_user | citext | 2147483647 | √ | null |
|
|
|||||||||||||||||||||||||||||||||||||||||
| approve_time | timestamptz | 35,6 | √ | null |
|
|
|||||||||||||||||||||||||||||||||||||||||
| checkin_user | citext | 2147483647 | √ | null |
|
|
|||||||||||||||||||||||||||||||||||||||||
| checkin_time | timestamptz | 35,6 | √ | CURRENT_TIMESTAMP |
|
|
|||||||||||||||||||||||||||||||||||||||||
| checkout_user | citext | 2147483647 | √ | null |
|
|
|||||||||||||||||||||||||||||||||||||||||
| checkout_time | timestamptz | 35,6 | √ | null |
|
|
|||||||||||||||||||||||||||||||||||||||||
| member_code | citext | 2147483647 | √ | null |
|
|
|||||||||||||||||||||||||||||||||||||||||
| channel_id | int4 | 10 | √ | null |
|
|
|||||||||||||||||||||||||||||||||||||||||
| origin_id | int4 | 10 | √ | null |
|
|
|||||||||||||||||||||||||||||||||||||||||
| arrive_by | text | 2147483647 | √ | null |
|
|
|||||||||||||||||||||||||||||||||||||||||
| arrive_from | text | 2147483647 | √ | null |
|
|
|||||||||||||||||||||||||||||||||||||||||
| depart_by | text | 2147483647 | √ | null |
|
|
|||||||||||||||||||||||||||||||||||||||||
| depart_to | text | 2147483647 | √ | null |
|
|
|||||||||||||||||||||||||||||||||||||||||
| folio_pattern_id | int4 | 10 | √ | null |
|
|
|||||||||||||||||||||||||||||||||||||||||
| voucher_no | citext | 2147483647 | √ | null |
|
|
|||||||||||||||||||||||||||||||||||||||||
| promo_code | citext | 2147483647 | √ | null |
|
|
|||||||||||||||||||||||||||||||||||||||||
| payment_method | bpchar | 3 | √ | null |
|
|
|||||||||||||||||||||||||||||||||||||||||
| sales_id | int4 | 10 | √ | null |
|
|
|||||||||||||||||||||||||||||||||||||||||
| market_id | int4 | 10 | √ | null |
|
|
|||||||||||||||||||||||||||||||||||||||||
| stay_type | bpchar | 1 | √ | 'D'::bpchar |
|
|
|||||||||||||||||||||||||||||||||||||||||
| folio_id | int4 | 10 | √ | null |
|
|
|||||||||||||||||||||||||||||||||||||||||
| credit_limit | t_money | 15,2 | √ | null |
|
|
|||||||||||||||||||||||||||||||||||||||||
| note | text | 2147483647 | √ | null |
|
|
|||||||||||||||||||||||||||||||||||||||||
| accno | int4 | 10 | √ | null |
|
|
|||||||||||||||||||||||||||||||||||||||||
| msg_count | int4 | 10 | √ | 0 |
|
|
|||||||||||||||||||||||||||||||||||||||||
| flag_count | int4 | 10 | √ | 0 |
|
|
|||||||||||||||||||||||||||||||||||||||||
| rateplan_id | int4 | 10 | √ | null |
|
|
|||||||||||||||||||||||||||||||||||||||||
| room_posted | bool | 1 | false |
|
|
||||||||||||||||||||||||||||||||||||||||||
| charge_to_booking | bool | 1 | false |
|
|
||||||||||||||||||||||||||||||||||||||||||
| promotion_id | int4 | 10 | √ | null |
|
|
|||||||||||||||||||||||||||||||||||||||||
| rate_id | int4 | 10 | √ | null |
|
|
|||||||||||||||||||||||||||||||||||||||||
| modify_user | text | 2147483647 | √ | null |
|
|
|||||||||||||||||||||||||||||||||||||||||
| modify_time | timestamptz | 35,6 | √ | null |
|
|
|||||||||||||||||||||||||||||||||||||||||
| house_used | bool | 1 | false |
|
|
||||||||||||||||||||||||||||||||||||||||||
| int4 | 10 | √ | null |
|
|
||||||||||||||||||||||||||||||||||||||||||
| bool | 1 | √ | (shared_register_id IS NOT NULL) |
|
|
||||||||||||||||||||||||||||||||||||||||||
| day_used | bool | 1 | √ | (arrival = departure) |
|
|
|||||||||||||||||||||||||||||||||||||||||
| nights | int2 | 5 | √ | (departure - arrival) |
|
|
|||||||||||||||||||||||||||||||||||||||||
| join_register_id | int4 | 10 | √ | null |
|
|
|||||||||||||||||||||||||||||||||||||||||
| is_join_room | bool | 1 | √ | (join_register_id IS NOT NULL) |
|
|
|||||||||||||||||||||||||||||||||||||||||
| is_group | bool | 1 | √ | (group_id IS NOT NULL) |
|
|
|||||||||||||||||||||||||||||||||||||||||
| early_checkout | bool | 1 | false |
|
|
||||||||||||||||||||||||||||||||||||||||||
| rsvtype_id | int4 | 10 | √ | null |
|
|
|||||||||||||||||||||||||||||||||||||||||
| early_checkout_date | date | 13 | √ | null |
|
|
|||||||||||||||||||||||||||||||||||||||||
| 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)) |
|
|
|||||||||||||||||||||||||||||||||||||||||
| total_deposit | t_money | 15,2 | √ | null |
|
|
|||||||||||||||||||||||||||||||||||||||||
| pax | text | 2147483647 | √ | fn_pax(adult, child, infant) |
|
|
Indexes
| Constraint Name | Type | Sort | Column(s) |
|---|---|---|---|
| pk_registration | Primary key | Asc | id |
| idx_registration_booking_id | Performance | Asc | booking_id |
| idx_registration_booking_item | Performance | Asc | booking_item |
| idx_registration_channel_id | Performance | Asc | channel_id |
| idx_registration_folpat_id | Performance | Asc | folio_pattern_id |
| idx_registration_group_id | Performance | Asc | group_id |
| idx_registration_guest_id | Performance | Asc | guest_id |
| idx_registration_market_id | Performance | Asc | market_id |
| idx_registration_mealtype_id | Performance | Asc | mealtype_id |
| idx_registration_origin_id | Performance | Asc | origin_id |
| idx_registration_promotion_id | Performance | Asc | promotion_id |
| idx_registration_rate_id | Performance | Asc | rate_id |
| idx_registration_rateplan_id | Performance | Asc | rateplan_id |
| idx_registration_room_id | Performance | Asc | room_id |
| idx_registration_rsvtype_id | Performance | Asc | rsvtype_id |
| idx_registration_sales_id | Performance | Asc | sales_id |
Check Constraints
| Constraint Name | Constraint |
|---|---|
| check_registration_status | ((status)::text = ANY (ARRAY['I'::text, 'O'::text, 'X'::text])) |

