PW-1086 batch 52

This commit is contained in:
Martin
2018-03-08 14:53:42 +01:00
parent 8c70c68164
commit fd3f4925b5
+16
View File
@@ -0,0 +1,16 @@
--PW-1069 Batch 52
-- Delete invalid values for batch
DELETE FROM "product-products_fields" WHERE fieldid = 36 AND (value !~ '^batch\d+$' OR value IS null);
-- Adding batches for a products
INSERT INTO "product-products_fields" (productid, fieldid, value)
SELECT productid, 36, 'batch52'
FROM "product-products"
WHERE visible = 1 AND browsable = 1
AND NOT productid IN (
SELECT productid FROM "product-products_fields"
WHERE fieldid = 36
)
ORDER BY productid
LIMIT 200;