Skip to content

public.loyalty_transactions

Description

Labels

svc-smarttab

Columns

NameTypeDefaultNullableChildrenParentsComment
idintegernextval('loyalty_transactions_id_seq'::regclass)false
customer_idintegerfalsepublic.customers
loyalty_program_idintegerfalsepublic.loyalty_programs
bill_iduuidtruepublic.bills
transaction_typevarchar(10)false
pointsintegerfalse
bill_amountnumeric(12,2)true
descriptionvarchar(255)true
created_attimestamp with time zonenow()true

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