groceries: add PLUS, Xenos and Amazing Oriental stores, is_food flag, PLUS EAN backfill
Deploy production / deploy (push) Successful in 1m7s
Deploy production / deploy (push) Successful in 1m7s
This commit is contained in:
1 parent
b23f7b3475
commit
3f30bb883f
14 files changed
+30444
-38
No files matched your search
@@ -0,0 +1,12 @@
|
||||
ALTER TABLE "groceries"."groups" ADD COLUMN "is_food" boolean DEFAULT true NOT NULL;--> statement-breakpoint
|
||||
ALTER TABLE "groceries"."items" ADD COLUMN "is_food" boolean DEFAULT true NOT NULL;--> statement-breakpoint
|
||||
-- New stores (Plus already exists): Xenos and Amazing Oriental (orientalwebshop.nl).
|
||||
INSERT INTO "groceries"."stores" ("slug", "name", "website", "color", "sort_order") VALUES
|
||||
('xenos', 'Xenos', 'https://www.xenos.nl', '#e6007e', 50),
|
||||
('amazing-oriental', 'Amazing Oriental', 'https://www.orientalwebshop.nl/nl/', '#2e7d32', 60)
|
||||
ON CONFLICT ("slug") DO NOTHING;--> statement-breakpoint
|
||||
-- Existing AH/Jumbo items: drugstore and household are not food (the importer keeps this current).
|
||||
UPDATE "groceries"."items" SET "is_food" = false WHERE "category" IN ('Drogisterij', 'Huishouden & dieren');--> statement-breakpoint
|
||||
UPDATE "groceries"."groups" g SET "is_food" = false
|
||||
WHERE NOT EXISTS (SELECT 1 FROM "groceries"."items" i WHERE i.group_id = g.id AND i.available AND i.is_food)
|
||||
AND EXISTS (SELECT 1 FROM "groceries"."items" i WHERE i.group_id = g.id AND i.available);
|
||||
Reference in new issue
Block a user