carts table
The carts table in the E-commerce Database Schema schema has 7 columns, keyed by id, with 1 foreign key to customers. 1 column in cart_items references it.
customer_id null is an anonymous cart, tracked by session_token until sign-in merges it.
Columns (7)
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | uuid | primary key | |
| customer_id | uuid | references customers.id | |
| session_token | varchar(64) | unique | |
| status | cart_status | not null | |
| currency | char(3) | not null | |
| created_at | timestamptz | not null | |
| updated_at | timestamptz | not null |
Relationships
carts.customer_idreferencescustomers.idcart_items.cart_idreferencescarts