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."
| 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) |
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));