Files
database/migrations/000.433.sql
T

26 lines
1.7 KiB
SQL

-- Blacklist week 2 batch (UK and NL for all product groups)
INSERT INTO product_blacklist (product_id, group_id, market_id)
SELECT productid, 1, (select id from markets where name = 'NL') FROM "product-products" WHERE ref3 = 'mJ1Xcd'
ON CONFLICT DO NOTHING;
INSERT INTO product_blacklist (product_id, group_id, market_id)
SELECT productid, 2, (select id from markets where name = 'NL') FROM "product-products" WHERE ref3 = 'mJ1Xcd'
ON CONFLICT DO NOTHING;
INSERT INTO product_blacklist (product_id, group_id, market_id)
SELECT productid, 3, (select id from markets where name = 'NL') FROM "product-products" WHERE ref3 = 'mJ1Xcd'
ON CONFLICT DO NOTHING;
INSERT INTO product_blacklist (product_id, group_id, market_id)
SELECT productid, 7, (select id from markets where name = 'NL') FROM "product-products" WHERE ref3 = 'mJ1Xcd'
ON CONFLICT DO NOTHING;
INSERT INTO product_blacklist (product_id, group_id, market_id)
SELECT productid, 1, (select id from markets where name = 'GB') FROM "product-products" WHERE ref3 = 'mJ1Xcd'
ON CONFLICT DO NOTHING;
INSERT INTO product_blacklist (product_id, group_id, market_id)
SELECT productid, 2, (select id from markets where name = 'GB') FROM "product-products" WHERE ref3 = 'mJ1Xcd'
ON CONFLICT DO NOTHING;
INSERT INTO product_blacklist (product_id, group_id, market_id)
SELECT productid, 3, (select id from markets where name = 'GB') FROM "product-products" WHERE ref3 = 'mJ1Xcd'
ON CONFLICT DO NOTHING;
INSERT INTO product_blacklist (product_id, group_id, market_id)
SELECT productid, 7, (select id from markets where name = 'GB') FROM "product-products" WHERE ref3 = 'mJ1Xcd'
ON CONFLICT DO NOTHING;