diff --git a/migrations/000.635.sql b/migrations/000.635.sql new file mode 100644 index 0000000..37fe283 --- /dev/null +++ b/migrations/000.635.sql @@ -0,0 +1,18 @@ +-- 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; +