public.loyalty_transactions
Description
Labels
svc-smarttab
Columns
| Name | Type | Default | Nullable | Children | Parents | Comment |
|---|---|---|---|---|---|---|
| id | integer | nextval('loyalty_transactions_id_seq'::regclass) | false | |||
| customer_id | integer | false | public.customers | |||
| loyalty_program_id | integer | false | public.loyalty_programs | |||
| bill_id | uuid | true | public.bills | |||
| transaction_type | varchar(10) | false | ||||
| points | integer | false | ||||
| bill_amount | numeric(12,2) | true | ||||
| description | varchar(255) | true | ||||
| created_at | timestamp with time zone | now() | true |
Viewpoints
| Name | Definition |
|---|---|
| Customer & Loyalty | Customer data, loyalty programs, and transactions |
Constraints
| Name | Type | Definition |
|---|---|---|
| loyalty_trans_type_check | CHECK | CHECK (((transaction_type)::text = ANY ((ARRAY['earn'::character varying, 'redeem'::character varying])::text[]))) |
| loyalty_transactions_customer_id_fkey | FOREIGN KEY | FOREIGN KEY (customer_id) REFERENCES customers(id) ON DELETE CASCADE |
| loyalty_transactions_loyalty_program_id_fkey | FOREIGN KEY | FOREIGN KEY (loyalty_program_id) REFERENCES loyalty_programs(id) ON DELETE RESTRICT |
| loyalty_transactions_bill_id_fkey | FOREIGN KEY | FOREIGN KEY (bill_id) REFERENCES bills(id) ON DELETE SET NULL |
| loyalty_transactions_pkey | PRIMARY KEY | PRIMARY KEY (id) |
Indexes
| Name | Definition |
|---|---|
| loyalty_transactions_pkey | CREATE UNIQUE INDEX loyalty_transactions_pkey ON public.loyalty_transactions USING btree (id) |
| ix_loyalty_transactions_customer_id | CREATE INDEX ix_loyalty_transactions_customer_id ON public.loyalty_transactions USING btree (customer_id) |
| ix_loyalty_transactions_loyalty_program_id | CREATE INDEX ix_loyalty_transactions_loyalty_program_id ON public.loyalty_transactions USING btree (loyalty_program_id) |
Relations
Generated by tbls