Columns
| Column | Type | Size | Nulls | Auto | Default | Children | Parents | Comments |
|---|---|---|---|---|---|---|---|---|
| id | int4 | 10 | √ | null |
|
|
||
| target_month | date | 13 | null |
|
|
|||
| segment_type | text | 2147483647 | null |
|
|
|||
| segment_id | int4 | 10 | √ | null |
|
|
||
| occ_percent | numeric | 7,2 | √ | null |
|
|
||
| room_night | int4 | 10 | √ | null |
|
|
||
| revenue | numeric | 18,2 | √ | null |
|
|
||
| adr | numeric | 18,2 | √ | null |
|
|
||
| rev_par | numeric | 18,2 | √ | null |
|
|
||
| note | text | 2147483647 | √ | null |
|
|
||
| created_at | timestamptz | 35,6 | CURRENT_TIMESTAMP |
|
|
|||
| created_by | text | 2147483647 | √ | null |
|
|
||
| updated_at | timestamptz | 35,6 | CURRENT_TIMESTAMP |
|
|
|||
| updated_by | text | 2147483647 | √ | null |
|
|
Indexes
| Constraint Name | Type | Sort | Column(s) |
|---|---|---|---|
| sales_target_pkey | Primary key | Asc | id |
| idx_sales_target_month | Performance | Asc | target_month |
| unq_sales_target_month_segment | Must be unique | Asc/Asc/Asc | target_month + segment_type + segment_id |
Check Constraints
| Constraint Name | Constraint |
|---|---|
| sales_target_nonnegative_check | ((room_night >= 0) AND (revenue >= (0)::numeric) AND (adr >= (0)::numeric) AND (rev_par >= (0)::numeric)) |
| sales_target_segment_check | (((segment_type = 'overall'::text) AND (segment_id IS NULL)) OR ((segment_type <> 'overall'::text) AND (segment_id IS NOT NULL))) |
| sales_target_segment_type_check | (segment_type = ANY (ARRAY['overall'::text, 'origin'::text, 'sales_staff'::text, 'market'::text, 'channel'::text, 'room_type'::text, 'rate_plan'::text])) |
| sales_target_month_check | (target_month = (date_trunc('month'::text, (target_month)::timestamp with time zone))::date) |
| sales_target_occ_percent_check | ((occ_percent >= (0)::numeric) AND (occ_percent <= (100)::numeric)) |
| sales_target_kpi_check | (num_nonnulls(occ_percent, room_night, revenue, adr, rev_par) > 0) |
