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 | Customer identifier. | |
| merchant_id | integer | false | public.merchants | Parent merchant ID. | ||
| customer_number | varchar(50) | false | Customer number (unique within merchant). | |||
| name | varchar(255) | false | Customer display name. | |||
| phone | varchar(20) | true | Customer phone number. | |||
| varchar(255) | true | Customer email address. | ||||
| address | text | true | Customer address. | |||
| is_active | boolean | true | true | Customer active status. | ||
| created_at | timestamp with time zone | now() | true | Record creation timestamp. | ||
| updated_at | timestamp with time zone | now() | true | Record last update timestamp. |
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