Skip to content

public.orders

Description

Labels

svc-smarttab

Columns

NameTypeDefaultNullableChildrenParentsComment
iduuidfalsepublic.bills public.order_items
device_iduuidtruepublic.devices
customer_idintegertruepublic.customers
order_numbervarchar(50)false
table_numbervarchar(50)true
subtotalnumeric(12,2)0.00false
taxnumeric(12,2)0.00false
total_amountnumeric(12,2)0.00false
statusvarchar(50)true
created_attimestamp with time zonenow()true
updated_attimestamp with time zonenow()true
merchant_idintegerfalsepublic.merchants
store_idintegerfalsepublic.stores

Viewpoints

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

Constraints

NameTypeDefinition
orders_merchant_id_fkeyFOREIGN KEYFOREIGN KEY (merchant_id) REFERENCES merchants(id) ON DELETE RESTRICT
orders_customer_id_fkeyFOREIGN KEYFOREIGN KEY (customer_id) REFERENCES customers(id) ON DELETE SET NULL
orders_store_id_fkeyFOREIGN KEYFOREIGN KEY (store_id) REFERENCES stores(id) ON DELETE RESTRICT
orders_device_id_fkeyFOREIGN KEYFOREIGN KEY (device_id) REFERENCES devices(device_id) ON DELETE RESTRICT
orders_pkeyPRIMARY KEYPRIMARY KEY (id)

Indexes

NameDefinition
orders_pkeyCREATE UNIQUE INDEX orders_pkey ON public.orders USING btree (id)
ix_orders_created_atCREATE INDEX ix_orders_created_at ON public.orders USING btree (created_at)
ix_orders_customer_idCREATE INDEX ix_orders_customer_id ON public.orders USING btree (customer_id)
ix_orders_device_idCREATE INDEX ix_orders_device_id ON public.orders USING btree (device_id)
ix_orders_order_numberCREATE INDEX ix_orders_order_number ON public.orders USING btree (order_number)
ix_orders_statusCREATE INDEX ix_orders_status ON public.orders USING btree (status)
ix_orders_merchant_idCREATE INDEX ix_orders_merchant_id ON public.orders USING btree (merchant_id)
ix_orders_store_idCREATE INDEX ix_orders_store_id ON public.orders USING btree (store_id)

Relations


Generated by tbls

MPAC — MP-Solution Advanced Cloud Service