Columns
| Column | Type | Size | Nulls | Auto | Default | Children | Parents | Comments | |||
|---|---|---|---|---|---|---|---|---|---|---|---|
| id | uuid | 2147483647 | gen_random_uuid() |
|
|
||||||
| catalog_item_id | uuid | 2147483647 | null |
|
|
||||||
| practice_location_id | text | 2147483647 | √ | null |
|
|
|||||
| cash_price_cents | int4 | 10 | 0 |
|
|
||||||
| card_price_cents | int4 | 10 | √ | null |
|
|
|||||
| unit_price_cents | int4 | 10 | 0 |
|
|
||||||
| cost_cents | int4 | 10 | √ | null |
|
|
|||||
| overhead_cents | int4 | 10 | √ | null |
|
|
|||||
| discount_cents | int4 | 10 | √ | null |
|
|
|||||
| discount_percent | numeric | 7,4 | √ | null |
|
|
|||||
| discount_type | text | 2147483647 | √ | null |
|
|
|||||
| tax_percent | numeric | 7,4 | 0 |
|
|
||||||
| is_active | bool | 1 | true |
|
|
||||||
| is_deleted | bool | 1 | false |
|
|
||||||
| legacy_practice_location_id | text | 2147483647 | √ | null |
|
|
|||||
| legacy_payload | jsonb | 2147483647 | '{}'::jsonb |
|
|
||||||
| created_at | timestamptz | 35,6 | now() |
|
|
||||||
| updated_at | timestamptz | 35,6 | now() |
|
|
Indexes
| Constraint Name | Type | Sort | Column(s) |
|---|---|---|---|
| catalog_item_location_pricing_pkey | Primary key | Asc | id |
| catalog_item_location_pricing_catalog_item_id_practice_loca_key | Must be unique | Asc/Asc | catalog_item_id + practice_location_id |
| catalog_item_location_pricing_global_unique | Must be unique | Asc | catalog_item_id |
| catalog_item_location_pricing_item_idx | Performance | Asc | catalog_item_id |
| catalog_item_location_pricing_location_active_idx | Performance | Asc/Asc | practice_location_id + is_active |
| catalog_item_location_pricing_location_unique | Must be unique | Asc/Asc | catalog_item_id + practice_location_id |
Check Constraints
| Constraint Name | Constraint |
|---|---|
| catalog_item_location_pricing_card_price_cents_check | (((card_price_cents IS NULL) OR (card_price_cents >= 0))) |
| catalog_item_location_pricing_discount_cents_check | (((discount_cents IS NULL) OR (discount_cents >= 0))) |
| catalog_item_location_pricing_cost_cents_check | (((cost_cents IS NULL) OR (cost_cents >= 0))) |
| catalog_item_location_pricing_unit_price_cents_check | ((unit_price_cents >= 0)) |
| catalog_item_location_pricing_discount_percent_check | (((discount_percent IS NULL) OR ((discount_percent >= (0)::numeric) AND (discount_percent <= (100)::numeric)))) |
| catalog_item_location_pricing_cash_price_cents_check | ((cash_price_cents >= 0)) |
| catalog_item_location_pricing_tax_percent_check | ((tax_percent >= (0)::numeric)) |
| catalog_item_location_pricing_overhead_cents_check | (((overhead_cents IS NULL) OR (overhead_cents >= 0))) |
| catalog_item_location_pricing_discount_type_check | (((discount_type IS NULL) OR (discount_type = ANY (ARRAY['amount'::text, 'percent'::text])))) |



