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)

Columns of the carts table
ColumnTypeConstraintsDescription
iduuidprimary key
customer_iduuidreferences customers.id
session_tokenvarchar(64)unique
statuscart_statusnot null
currencychar(3)not null
created_attimestamptznot null
updated_attimestamptznot null

Relationships