From 5ece848ed583bb9e6f99880dc326d3ddacadfbf6 Mon Sep 17 00:00:00 2001 From: Fredrik Ringqvist Date: Thu, 11 Apr 2019 08:32:16 +0200 Subject: [PATCH] P5-3759 Create batch 225 --- migrations/000.100.sql | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 migrations/000.100.sql diff --git a/migrations/000.100.sql b/migrations/000.100.sql new file mode 100644 index 0000000..42d6f24 --- /dev/null +++ b/migrations/000.100.sql @@ -0,0 +1,16 @@ +-- P5-3759 Batch 225 + +-- 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, 'batch225' + 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 +;