Files
Rikard BartholfandGitHub ddcbd0afb0 Archive old migrations (#426)
* Archive old migrations

* Fix invalid placement of migrations
2024-10-17 11:19:12 +02:00

16 lines
519 B
SQL

--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;