Skip to content

public.loyalty_transactions

Description

Labels

svc-smarttab

Columns

NameTypeDefaultNullableChildrenParentsComment
idintegernextval('loyalty_transactions_id_seq'::regclass)falseLoyalty transaction identifier.
customer_idintegerfalsepublic.customersCustomer ID.
loyalty_program_idintegerfalsepublic.loyalty_programsLoyalty program ID.
bill_iduuidtruepublic.billsBill ID (source transaction).
transaction_typevarchar(10)falseTransaction type: earn or redeem.
pointsintegerfalsePoints earned (positive) or redeemed (negative).
bill_amountnumeric(12,2)trueBill amount for earn transactions.
descriptionvarchar(255)trueTransaction description.
created_attimestamp with time zonenow()trueRecord creation timestamp.

Viewpoints

NameDefinition
Customer & LoyaltyCustomer data, loyalty programs, and transactions

Constraints

NameTypeDefinition
loyalty_trans_type_checkCHECKCHECK (((transaction_type)::text = ANY ((ARRAY['earn'::character varying, 'redeem'::character varying])::text[])))
loyalty_transactions_customer_id_fkeyFOREIGN KEYFOREIGN KEY (customer_id) REFERENCES customers(id) ON DELETE CASCADE
loyalty_transactions_loyalty_program_id_fkeyFOREIGN KEYFOREIGN KEY (loyalty_program_id) REFERENCES loyalty_programs(id) ON DELETE RESTRICT
loyalty_transactions_bill_id_fkeyFOREIGN KEYFOREIGN KEY (bill_id) REFERENCES bills(id) ON DELETE SET NULL
loyalty_transactions_pkeyPRIMARY KEYPRIMARY KEY (id)

Indexes

NameDefinition
loyalty_transactions_pkeyCREATE UNIQUE INDEX loyalty_transactions_pkey ON public.loyalty_transactions USING btree (id)
ix_loyalty_transactions_customer_idCREATE INDEX ix_loyalty_transactions_customer_id ON public.loyalty_transactions USING btree (customer_id)
ix_loyalty_transactions_loyalty_program_idCREATE INDEX ix_loyalty_transactions_loyalty_program_id ON public.loyalty_transactions USING btree (loyalty_program_id)

Relations


Generated by tbls

MPAC — MP-Solution Advanced Cloud Service