diff --git a/migrations/000.056.sql b/migrations/000.056.sql new file mode 100644 index 0000000..5a0e8aa --- /dev/null +++ b/migrations/000.056.sql @@ -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; \ No newline at end of file