Files

19 lines
783 B
SQL
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
-- Add matte-wallpaper material and drop legacy price column from product-materials
-- 1. Insert the new material
INSERT INTO "product-materials" (materialid, material)
VALUES (7, 'matte-wallpaper');
-- 2. Add pricing rows for all existing market × segment combinations (copy from premium-wallpaper, material_id=4)
INSERT INTO prices_wallpaper_m2 (material_id, segment_id, market_id, price, updated)
SELECT 7, segment_id, market_id, price, NOW()
FROM prices_wallpaper_m2
WHERE material_id = 4;
-- 3. Add to product-printproducts_materials for all print products that have premium-wallpaper (material 4)
INSERT INTO "product-printproducts_materials" (printid, materialid)
SELECT printid, 7
FROM "product-printproducts_materials"
WHERE materialid = 4;