public.loyalty_programs
Description
Labels
svc-smarttab
Columns
| Name | Type | Default | Nullable | Children | Parents | Comment |
|---|---|---|---|---|---|---|
| id | integer | nextval('loyalty_programs_id_seq'::regclass) | false | public.loyalty_transactions | Loyalty program identifier. | |
| merchant_id | integer | false | public.merchants | Parent merchant ID. | ||
| program_name | varchar(255) | false | Loyalty program display name. | |||
| points_per_unit | numeric(10,2) | false | Points earned per currency unit. | |||
| points_value | numeric(10,4) | false | Currency value per point. | |||
| min_points_redeem | integer | 0 | false | Minimum points for redemption. | ||
| is_active | boolean | true | true | Loyalty program active status. | ||
| created_at | timestamp with time zone | now() | true | Record creation timestamp. | ||
| updated_at | timestamp with time zone | now() | true | Record last update timestamp. |
Viewpoints
| Name | Definition |
|---|---|
| Customer & Loyalty | Customer data, loyalty programs, and transactions |
Constraints
| Name | Type | Definition |
|---|---|---|
| loyalty_points_per_unit_check | CHECK | CHECK ((points_per_unit > (0)::numeric)) |
| loyalty_points_value_check | CHECK | CHECK ((points_value > (0)::numeric)) |
| loyalty_programs_merchant_id_fkey | FOREIGN KEY | FOREIGN KEY (merchant_id) REFERENCES merchants(id) ON DELETE CASCADE |
| loyalty_programs_pkey | PRIMARY KEY | PRIMARY KEY (id) |
Indexes
| Name | Definition |
|---|---|
| loyalty_programs_pkey | CREATE UNIQUE INDEX loyalty_programs_pkey ON public.loyalty_programs USING btree (id) |
| ix_loyalty_programs_merchant_id | CREATE INDEX ix_loyalty_programs_merchant_id ON public.loyalty_programs USING btree (merchant_id) |
Relations
Generated by tbls