2 -- @description: Add tables for part information for shop
4 -- @depends: release_3_5_0 shops
7 CREATE TABLE shop_parts (
9 shop_id INTEGER NOT NULL REFERENCES shops(id),
10 part_id INTEGER NOT NULL REFERENCES parts(id),
11 shop_description TEXT,
12 itime TIMESTAMP DEFAULT now(),
14 last_update TIMESTAMP,
15 show_date DATE, -- the starting date for displaying part in shop
17 front_page BOOLEAN NOT NULL DEFAULT false,
18 active BOOLEAN NOT NULL DEFAULT false, -- rather than obsolete
19 shop_category TEXT[][],
20 active_price_source TEXT,
21 metatag_keywords TEXT,
22 metatag_description TEXT,
24 UNIQUE (part_id, shop_id) -- make sure a shop_part appears only once per shop and part
27 CREATE TRIGGER mtime_shop_parts BEFORE UPDATE ON shop_parts
28 FOR EACH ROW EXECUTE PROCEDURE set_mtime();