Skip to content

public.bill_operation_histories

Description

Labels

svc-smarttab

Columns

NameTypeDefaultNullableChildrenParentsComment
iduuidgen_random_uuid()false
merchant_idintegerfalsepublic.merchants
store_idintegerfalsepublic.stores
caller_typevarchar(20)'user'::character varyingfalse
caller_idvarchar(50)true
bill_iduuidfalsepublic.bills
payment_iduuidtruepublic.payments
operation_typevarchar(20)false
operation_actionvarchar(50)false
metadatajsonb'{}'::jsonbtrue
created_attimestamp with time zonenow()false

Viewpoints

NameDefinition
Order & BillingOrder lifecycle — Orders → Bills → Payments → Settlements

Constraints

NameTypeDefinition
bill_operation_histories_caller_type_checkCHECKCHECK (((caller_type)::text = ANY ((ARRAY['device'::character varying, 'user'::character varying])::text[])))
bill_operation_histories_operation_type_checkCHECKCHECK (((operation_type)::text = ANY ((ARRAY['bill'::character varying, 'payment'::character varying])::text[])))
bill_operation_histories_merchant_id_fkeyFOREIGN KEYFOREIGN KEY (merchant_id) REFERENCES merchants(id) ON DELETE RESTRICT
bill_operation_histories_store_id_fkeyFOREIGN KEYFOREIGN KEY (store_id) REFERENCES stores(id) ON DELETE RESTRICT
bill_operation_histories_bill_id_fkeyFOREIGN KEYFOREIGN KEY (bill_id) REFERENCES bills(id) ON DELETE CASCADE
bill_operation_histories_payment_id_fkeyFOREIGN KEYFOREIGN KEY (payment_id) REFERENCES payments(id) ON DELETE SET NULL
bill_operation_histories_pkeyPRIMARY KEYPRIMARY KEY (id)

Indexes

NameDefinition
bill_operation_histories_pkeyCREATE UNIQUE INDEX bill_operation_histories_pkey ON public.bill_operation_histories USING btree (id)
idx_boh_bill_createdCREATE INDEX idx_boh_bill_created ON public.bill_operation_histories USING btree (bill_id, created_at)

Relations


Generated by tbls

MPAC — MP-Solution Advanced Cloud Service