cart_product

Description

Information of products in the cart.

Definition

Column Type Constraint Description
shop TEXT PRIMARY KEY Shop ID. (shop.username)
cart_id INTEGER Cart ID. (cart.id)
index INTEGER Index of products in added order. 0-origin.
product_id INTEGER NOT NULL Product ID. (product.id)
quantity INTEGER NOT NULL Quantity.

Related tables

Query

CREATE TABLE cart_product(
shop       TEXT,
cart_id    INTEGER,
index      INTEGER,
product_id INTEGER NOT NULL,
quantity   INTEGER NOT NULL,
PRIMARY KEY (shop, cart_id, index));