15 lines
947 B
SQL
15 lines
947 B
SQL
-- Bons: „Nicht zum Kochen“ und Gewichtsware (Kai, 7.11.2026, 26.11.33).
|
|
-- Ein gelernter Bontext ohne Zutat heißt: Das kaufen wir, aber nicht zum Kochen
|
|
-- (Toastbrot, Klopapier). Beim nächsten Bon landet er gleich unten. Gewogene Ware
|
|
-- („0,416 kg x 2,79 €/kg“) trägt die Menge in kg; ihr Preis gilt je 1000 g.
|
|
|
|
alter table ingredient_aliases alter column ingredient_id drop not null;
|
|
alter table ingredient_aliases add constraint ingredient_aliases_skip_no_pack
|
|
check (ingredient_id is not null or (pack_qty is null and pack_unit is null));
|
|
|
|
alter table receipt_lines drop constraint if exists receipt_lines_match_source_check;
|
|
alter table receipt_lines add constraint receipt_lines_match_source_check
|
|
check (match_source in ('alias', 'product', 'search', 'ai', 'skip'));
|
|
alter table receipt_lines add column weighed boolean not null default false;
|
|
alter table receipt_lines add column skipped boolean not null default false;
|