public.customers
Description
Labels
svc-smarttab
Columns
| Name | Type | Default | Nullable | Children | Parents | Comment |
|---|---|---|---|---|---|---|
| id | integer | nextval('customers_id_seq'::regclass) | false | public.orders public.bills public.loyalty_transactions public.receipts public.invoices | ||
| merchant_id | integer | false | public.merchants | |||
| customer_number | varchar(50) | false | ||||
| name | varchar(255) | false | ||||
| phone | varchar(20) | true | ||||
| varchar(255) | true | |||||
| address | text | true | ||||
| is_active | boolean | true | true | |||
| created_at | timestamp with time zone | now() | true | |||
| updated_at | timestamp with time zone | now() | true |
Viewpoints
| Name | Definition |
|---|---|
| Customer & Loyalty | Customer data, loyalty programs, and transactions |
Constraints
| Name | Type | Definition |
|---|---|---|
| customers_contact_check | CHECK | CHECK (((phone IS NOT NULL) OR (email IS NOT NULL))) |
| customers_merchant_id_fkey | FOREIGN KEY | FOREIGN KEY (merchant_id) REFERENCES merchants(id) ON DELETE RESTRICT |
| customers_pkey | PRIMARY KEY | PRIMARY KEY (id) |
| uq_customers_merchant_customer_number | UNIQUE | UNIQUE (merchant_id, customer_number) |
Indexes
| Name | Definition |
|---|---|
| customers_pkey | CREATE UNIQUE INDEX customers_pkey ON public.customers USING btree (id) |
| uq_customers_merchant_customer_number | CREATE UNIQUE INDEX uq_customers_merchant_customer_number ON public.customers USING btree (merchant_id, customer_number) |
| ix_customers_email | CREATE INDEX ix_customers_email ON public.customers USING btree (email) |
| ix_customers_merchant_id | CREATE INDEX ix_customers_merchant_id ON public.customers USING btree (merchant_id) |
| ix_customers_phone | CREATE INDEX ix_customers_phone ON public.customers USING btree (phone) |
Relations
Generated by tbls