Columns
| Column | Type | Size | Nulls | Auto | Default | Children | Parents | Comments | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id | uuid | 2147483647 | gen_random_uuid() |
|
|
|||||||||
| practice_id | text | 2147483647 | null |
|
|
|||||||||
| name | text | 2147483647 | null |
|
|
|||||||||
| description | text | 2147483647 | √ | null |
|
|
||||||||
| amount_mode | text | 2147483647 | null |
|
|
|||||||||
| fixed_amount_cents | int4 | 10 | √ | null |
|
|
||||||||
| currency_code | bpchar | 3 | 'USD'::bpchar |
|
|
|||||||||
| image_url | text | 2147483647 | √ | null |
|
|
||||||||
| image_alt_text | text | 2147483647 | √ | null |
|
|
||||||||
| is_active | bool | 1 | true |
|
|
|||||||||
| created_at | timestamptz | 35,6 | now() |
|
|
|||||||||
| updated_at | timestamptz | 35,6 | now() |
|
|
Indexes
| Constraint Name | Type | Sort | Column(s) |
|---|---|---|---|
| gift_card_definitions_pkey | Primary key | Asc | id |
| gift_card_definitions_practice_active_idx | Performance | Asc/Asc | practice_id + is_active |
| gift_card_definitions_practice_name_unique | Must be unique | Asc | practice_id |
Check Constraints
| Constraint Name | Constraint |
|---|---|
| gift_card_definitions_check | ((((amount_mode = 'fixed'::text) AND (fixed_amount_cents IS NOT NULL)) OR ((amount_mode = 'custom'::text) AND (fixed_amount_cents IS NULL)))) |
| gift_card_definitions_fixed_amount_cents_check | (((fixed_amount_cents IS NULL) OR (fixed_amount_cents > 0))) |
| gift_card_definitions_amount_mode_check | ((amount_mode = ANY (ARRAY['fixed'::text, 'custom'::text]))) |
| gift_card_definitions_currency_code_check | ((currency_code ~ '^[A-Z]{3}$'::text)) |



