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