From 1d0a75df514ea22844fd99260f6092a5168a3403 Mon Sep 17 00:00:00 2001 From: Martin Date: Mon, 9 Apr 2018 11:15:31 +0200 Subject: [PATCH] PW-1117 create batch53 --- migrations/000.060.sql | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 migrations/000.060.sql diff --git a/migrations/000.060.sql b/migrations/000.060.sql new file mode 100644 index 0000000..672ec32 --- /dev/null +++ b/migrations/000.060.sql @@ -0,0 +1,16 @@ +--PW-1117 Batch 53 + +-- 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, 'batch53' + 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;