Skip to content

public.customers

Description

Labels

svc-smarttab

Columns

NameTypeDefaultNullableChildrenParentsComment
idintegernextval('customers_id_seq'::regclass)falsepublic.orders public.bills public.loyalty_transactions public.receiptsCustomer identifier.
merchant_idintegerfalsepublic.merchantsParent merchant ID.
customer_numbervarchar(50)falseCustomer number (unique within merchant).
namevarchar(255)falseCustomer display name.
phonevarchar(20)trueCustomer phone number.
emailvarchar(255)trueCustomer email address.
addresstexttrueCustomer address.
is_activebooleantruetrueCustomer active status.
created_attimestamp with time zonenow()trueRecord creation timestamp.
updated_attimestamp with time zonenow()trueRecord last update timestamp.

Viewpoints

NameDefinition
Customer & LoyaltyCustomer data, loyalty programs, and transactions

Constraints

NameTypeDefinition
customers_contact_checkCHECKCHECK (((phone IS NOT NULL) OR (email IS NOT NULL)))
customers_merchant_id_fkeyFOREIGN KEYFOREIGN KEY (merchant_id) REFERENCES merchants(id) ON DELETE RESTRICT
customers_pkeyPRIMARY KEYPRIMARY KEY (id)
uq_customers_merchant_customer_numberUNIQUEUNIQUE (merchant_id, customer_number)

Indexes

NameDefinition
customers_pkeyCREATE UNIQUE INDEX customers_pkey ON public.customers USING btree (id)
uq_customers_merchant_customer_numberCREATE UNIQUE INDEX uq_customers_merchant_customer_number ON public.customers USING btree (merchant_id, customer_number)
ix_customers_emailCREATE INDEX ix_customers_email ON public.customers USING btree (email)
ix_customers_merchant_idCREATE INDEX ix_customers_merchant_id ON public.customers USING btree (merchant_id)
ix_customers_phoneCREATE INDEX ix_customers_phone ON public.customers USING btree (phone)

Relations


Generated by tbls

MPAC — MP-Solution Advanced Cloud Service