groceries: add PLUS, Xenos and Amazing Oriental stores, is_food flag, PLUS EAN backfill
All checks were successful
Deploy production / deploy (push) Successful in 1m7s
All checks were successful
Deploy production / deploy (push) Successful in 1m7s
This commit is contained in:
12
drizzle/20261025171621_groceries_more_stores/migration.sql
Normal file
12
drizzle/20261025171621_groceries_more_stores/migration.sql
Normal file
@@ -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);
|
||||
29492
drizzle/20261025171621_groceries_more_stores/snapshot.json
Normal file
29492
drizzle/20261025171621_groceries_more_stores/snapshot.json
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user