item_tag_map

Description

Mapping of product and tag.

Because tag has not to be related with a category, it would be renamed to "product_tag_map."

Also, "item_id" will become "product_id."

Definition

Column Type Constraint Description
shop TEXT PRIMARY KEY Shop ID. (shop.username)
item_id INTEGER Item ID. (item.id)
tag_id INTEGER Tag ID. (tag.id)

Related tables

Query

CREATE TABLE item_tag_map(
shop    TEXT    NOT NULL,
item_id INTEGER NOT NULL,
tag_id  INTEGER NOT NULL,
PRIMARY KEY(shop, item_id, tag_id));