Columns
| Column | Type | Size | Nulls | Auto | Default | Children | Parents | Comments | |||
|---|---|---|---|---|---|---|---|---|---|---|---|
| shop_id | bpchar | 8 | √ | to_char(nextval('shop_id_seq'::regclass), '"SHOP-"FM000'::text) |
|
|
|||||
| name | varchar | 32 | null |
|
|
||||||
| type | varchar | 16 | null |
|
|
||||||
| city | text | 2147483647 | √ | null |
|
|
|||||
| state | bpchar | 2 | √ | null |
|
|
|||||
| country | bpchar | 3 | √ | null |
|
|
|||||
| zip | bpchar | 5 | √ | null |
|
|
Indexes
| Constraint Name | Type | Sort | Column(s) |
|---|---|---|---|
| shops_pkey | Primary key | Asc | shop_id |
Check Constraints
| Constraint Name | Constraint |
|---|---|
| shops_id_check | ((shop_id ~ '^SHOP-\d{3}$'::text)) |
| shops_country_check | (((((type)::text <> 'ONLINE STORE'::text) AND (country IS NOT NULL)) OR (((type)::text = 'ONLINE STORE'::text) AND (country IS NULL)))) |
| shops_type_check | (((type)::text = ANY ((ARRAY['BOOKSTORE'::character varying, 'EVENT STORE'::character varying, 'LCS'::character varying, 'LIBRARY'::character varying, 'PRIVATE SELLER'::character varying, 'PUBLISHER'::character varying, 'ONLINE STORE'::character varying])::text[]))) |

