Columns
| Column | Type | Size | Nulls | Auto | Default | Children | Parents | Comments | |||
|---|---|---|---|---|---|---|---|---|---|---|---|
| id | uuid | 2147483647 | gen_random_uuid() |
|
|
||||||
| loyalty_profile_id | uuid | 2147483647 | null |
|
|
||||||
| points_delta | int4 | 10 | null |
|
|
||||||
| points_balance_after | int4 | 10 | null |
|
|
||||||
| reason | text | 2147483647 | √ | null |
|
|
|||||
| actor_user_id | text | 2147483647 | √ | null |
|
|
|||||
| occurred_at | timestamptz | 35,6 | now() |
|
|
||||||
| created_at | timestamptz | 35,6 | now() |
|
|
||||||
| source_type | text | 2147483647 | √ | null |
|
|
|||||
| source_id | text | 2147483647 | √ | null |
|
|
|||||
| eligible_amount_cents | int4 | 10 | √ | null |
|
|
Indexes
| Constraint Name | Type | Sort | Column(s) |
|---|---|---|---|
| loyalty_point_adjustments_pkey | Primary key | Asc | id |
| loyalty_point_adjustments_profile_idx | Performance | Asc/Desc | loyalty_profile_id + occurred_at |
| loyalty_point_adjustments_source_idx | Performance | Asc/Asc | source_type + source_id |
| loyalty_point_adjustments_source_unique | Must be unique | Asc/Asc/Asc | loyalty_profile_id + source_type + source_id |
Check Constraints
| Constraint Name | Constraint |
|---|---|
| loyalty_point_adjustments_points_delta_check | ((points_delta <> 0)) |
| loyalty_point_adjustments_eligible_amount_cents_check | (((eligible_amount_cents IS NULL) OR (eligible_amount_cents >= 0))) |
| loyalty_point_adjustments_points_balance_after_check | ((points_balance_after >= 0)) |


